diff --git a/helm-charts/k8s-mediaserver/templates/jackett-resources.yml b/helm-charts/k8s-mediaserver/templates/jackett-resources.yml index 65c608e..382e96f 100644 --- a/helm-charts/k8s-mediaserver/templates/jackett-resources.yml +++ b/helm-charts/k8s-mediaserver/templates/jackett-resources.yml @@ -142,6 +142,8 @@ apiVersion: v1 kind: Service metadata: name: jackett-lb + annotations: + {{- include .Values.jackett.service.extraLBService.annotations . | nindent 4 }} labels: {{- include "k8s-mediaserver.labels" . | nindent 4 }} spec: diff --git a/helm-charts/k8s-mediaserver/templates/plex-resources.yml b/helm-charts/k8s-mediaserver/templates/plex-resources.yml index c5b6507..956df2e 100644 --- a/helm-charts/k8s-mediaserver/templates/plex-resources.yml +++ b/helm-charts/k8s-mediaserver/templates/plex-resources.yml @@ -108,6 +108,8 @@ apiVersion: v1 kind: Service metadata: name: plex-lb + annotations: + {{- include .Values.plex.service.extraLBService.annotations . | nindent 4 }} labels: {{- include "k8s-mediaserver.labels" . | nindent 4 }} spec: diff --git a/helm-charts/k8s-mediaserver/templates/prowlarr-resources.yml b/helm-charts/k8s-mediaserver/templates/prowlarr-resources.yml new file mode 100644 index 0000000..f6eb453 --- /dev/null +++ b/helm-charts/k8s-mediaserver/templates/prowlarr-resources.yml @@ -0,0 +1,192 @@ +{{ if .Values.prowlarr.enabled }} +--- +### CONFIGMAPS +## INIT-CONTAINER +apiVersion: v1 +data: + config.xml: | + + {{ .Values.prowlarr.ingress.path }} + + init-prowlarr.sh: | + #!/bin/bash + echo "### Initializing config ###" + if [ ! -f /prowlarr-config/config.xml ]; then + cp -n /init-prowlarr/config.xml /prowlarr-config/config.xml + echo "### No configuration found, intialized with default settings ###" + fi +kind: ConfigMap +metadata: + name: init-prowlarr-cm +--- +## APPLICATION +apiVersion: v1 +kind: ConfigMap +metadata: + name: prowlarr-config +data: + PGID: "{{ .Values.general.pgid }}" + PUID: "{{ .Values.general.puid }}" +--- +### DEPLOYMENT +apiVersion: apps/v1 +kind: Deployment +metadata: + name: prowlarr + labels: + {{- include "k8s-mediaserver.labels" . | nindent 4 }} +spec: + replicas: 1 + selector: + matchLabels: + {{- include "k8s-mediaserver.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "k8s-mediaserver.selectorLabels" . | nindent 8 }} + app: prowlarr + spec: + initContainers: + - name: config-prowlarr + image: docker.io/ubuntu:groovy + command: ["/init-prowlarr/init-prowlarr.sh"] + volumeMounts: + - mountPath: /init-prowlarr + name: init-files-prowlarr + {{- if .Values.jackett.volume }} + - name: {{ .Values.jackett.volume.name }} + mountPath: /prowlarr-config + {{- else }} + - name: mediaserver-volume + mountPath: /prowlarr-config + subPath: "{{ .Values.general.storage.subPaths.config }}/prowlarr" + {{- end }} + securityContext: + runAsUser: {{ .Values.general.puid }} + runAsGroup: {{ .Values.general.pgid }} + containers: + - name: {{ .Chart.Name }} + envFrom: + - configMapRef: + name: prowlarr-config + image: "{{ .Values.prowlarr.container.image }}:{{ .Values.prowlarr.container.tag | default .Values.general.image_tag }}" + imagePullPolicy: Always + readinessProbe: + tcpSocket: + port: {{ .Values.prowlarr.container.port }} + initialDelaySeconds: 10 + periodSeconds: 20 + ports: + - name: prowlarr-port + containerPort: {{ .Values.prowlarr.container.port }} + protocol: TCP + volumeMounts: + {{- if .Values.prowlarr.volume }} + - name: {{ .Values.prowlarr.volume.name }} + mountPath: /config + {{- else }} + - name: mediaserver-volume + mountPath: "/config" + subPath: "{{ .Values.general.storage.subPaths.config }}/prowlarr" + {{- end }} + {{- with .Values.prowlarr.resources }} + resources: + {{- toYaml . | nindent 12 }} + {{- end }} + volumes: + {{ if not .Values.general.storage.customVolume }} + - name: mediaserver-volume + persistentVolumeClaim: + claimName: {{ .Values.general.storage.pvcName }} + {{ else }} + - name: mediaserver-volume + {{- toYaml .Values.general.storage.volumes | nindent 10 }} + {{ end }} + {{- if .Values.prowlarr.volume }} + - name: {{ .Values.prowlarr.volume.name }} + persistentVolumeClaim: + claimName: {{ .Values.prowlarr.volume.name }} + {{- end }} + - name: init-files-prowlarr + configMap: + defaultMode: 493 + name: init-prowlarr-cm + {{- with .Values.general.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} +--- +### SERVICES +apiVersion: v1 +kind: Service +metadata: + name: prowlarr + labels: + {{- include "k8s-mediaserver.labels" . | nindent 4 }} +spec: + type: {{ .Values.prowlarr.service.type }} + ports: + - port: {{ .Values.prowlarr.service.port }} + targetPort: {{ .Values.prowlarr.container.port }} + protocol: TCP +{{ if eq .Values.prowlarr.service.type "NodePort" }} + nodePort: {{ .Values.prowlarr.service.nodePort }} +{{ end }} + name: prowlarr-port + selector: + app: prowlarr + +--- +{{ if .Values.prowlarr.service.extraLBService }} +apiVersion: v1 +kind: Service +metadata: + name: prowlarr-lb + annotations: + {{- include .Values.prowlarr.service.extraLBService.annotations . | nindent 4 }} + labels: + {{- include "k8s-mediaserver.labels" . | nindent 4 }} +spec: + type: LoadBalancer + ports: + - port: {{ .Values.prowlarr.service.port }} + targetPort: {{ .Values.prowlarr.container.port }} + protocol: TCP + name: prowlarr-port + selector: + app: prowlarr +{{ end }} +--- +### INGRESS ### +{{ if .Values.prowlarr.ingress.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: prowlarr + labels: + {{- include "k8s-mediaserver.labels" . | nindent 4 }} + {{- with .Values.prowlarr.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{ if .Values.prowlarr.ingress.tls.enabled }} + tls: + - hosts: + - {{ .Values.general.ingress_host | quote }} + secretName: {{ .Values.prowlarr.ingress.tls.secretName }} +{{ end }} + ingressClassName: {{ .Values.general.ingress.ingressClassName }} + rules: + - host: {{ .Values.general.ingress_host | quote }} + http: + paths: + - path: {{ .Values.prowlarr.ingress.path }} + pathType: Prefix + backend: + service: + name: prowlarr + port: + number: {{ .Values.prowlarr.service.port }} +{{ end }} +{{ end }} diff --git a/helm-charts/k8s-mediaserver/templates/radarr-resources.yml b/helm-charts/k8s-mediaserver/templates/radarr-resources.yml index 1f7b0da..0764a97 100644 --- a/helm-charts/k8s-mediaserver/templates/radarr-resources.yml +++ b/helm-charts/k8s-mediaserver/templates/radarr-resources.yml @@ -151,6 +151,8 @@ apiVersion: v1 kind: Service metadata: name: radarr-lb + annotations: + {{- include .Values.radarr.service.extraLBService.annotations . | nindent 4 }} labels: {{- include "k8s-mediaserver.labels" . | nindent 4 }} spec: diff --git a/helm-charts/k8s-mediaserver/templates/sabnzbd-resources.yml b/helm-charts/k8s-mediaserver/templates/sabnzbd-resources.yml index 41ff9d7..cb9fbbc 100644 --- a/helm-charts/k8s-mediaserver/templates/sabnzbd-resources.yml +++ b/helm-charts/k8s-mediaserver/templates/sabnzbd-resources.yml @@ -469,6 +469,8 @@ apiVersion: v1 kind: Service metadata: name: sabnzbd-lb + annotations: + {{- include .Values.sabnzbd.service.extraLBService.annotations . | nindent 4 }} labels: {{- include "k8s-mediaserver.labels" . | nindent 4 }} spec: diff --git a/helm-charts/k8s-mediaserver/templates/sonarr-resources.yml b/helm-charts/k8s-mediaserver/templates/sonarr-resources.yml index 1141289..1fdc04d 100644 --- a/helm-charts/k8s-mediaserver/templates/sonarr-resources.yml +++ b/helm-charts/k8s-mediaserver/templates/sonarr-resources.yml @@ -149,6 +149,8 @@ apiVersion: v1 kind: Service metadata: name: sonarr-lb + annotations: + {{- include .Values.sonarr.service.extraLBService.annotations . | nindent 4 }} labels: {{- include "k8s-mediaserver.labels" . | nindent 4 }} spec: diff --git a/helm-charts/k8s-mediaserver/templates/transmission-resources.yml b/helm-charts/k8s-mediaserver/templates/transmission-resources.yml index 58cf6af..ba0bf20 100644 --- a/helm-charts/k8s-mediaserver/templates/transmission-resources.yml +++ b/helm-charts/k8s-mediaserver/templates/transmission-resources.yml @@ -255,6 +255,8 @@ apiVersion: v1 kind: Service metadata: name: transmission-lb + annotations: + {{- include .Values.transmission.service.extraLBService.annotations . | nindent 4 }} labels: {{- include "k8s-mediaserver.labels" . | nindent 4 }} spec: diff --git a/helm-charts/k8s-mediaserver/values.yaml b/helm-charts/k8s-mediaserver/values.yaml index c477095..340df81 100644 --- a/helm-charts/k8s-mediaserver/values.yaml +++ b/helm-charts/k8s-mediaserver/values.yaml @@ -201,6 +201,34 @@ sabnzbd: # storage: 5Gi # selector: {} +prowlarr: + enabled: true + container: + image: docker.io/linuxserver/prowlarr + nodeSelector: {} + port: 9696 + service: + type: ClusterIP + port: 9696 + nodePort: + extraLBService: false + ingress: + enabled: true + annotations: {} + path: /prowlarr + tls: + enabled: false + secretName: "" + resources: {} + volume: {} + # name: pvc-prowlarr-config + # storageClassName: longhorn + # annotations: {} + # labels: {} + # accessModes: ReadWriteOnce + # storage: 5Gi + # selector: {} + plex: enabled: true claim: "CHANGEME"