--- apiVersion: apps/v1 kind: Deployment metadata: name: sonarr namespace: media-apps spec: replicas: 1 strategy: type: Recreate selector: matchLabels: app: sonarr template: metadata: labels: app: sonarr spec: securityContext: fsGroup: 1000 initContainers: - name: config-template image: busybox:latest imagePullPolicy: IfNotPresent command: ["/bin/sh"] args: - -c - | cp /config-template/config.xml /config/config.xml sed -i "s/{{API_KEY}}/$API_KEY/g" /config/config.xml env: - name: API_KEY valueFrom: secretKeyRef: name: sonarr-secrets key: apitoken securityContext: runAsUser: 1000 runAsGroup: 1000 runAsNonRoot: true volumeMounts: - name: config-template mountPath: /config-template - name: config mountPath: /config containers: - name: sonarr image: ghcr.io/home-operations/sonarr:rolling imagePullPolicy: IfNotPresent ports: - name: http containerPort: 8989 protocol: TCP env: - name: TZ value: Australia/Sydney - name: PORT value: "8989" resources: requests: cpu: 50m memory: 128Mi limits: cpu: "1" memory: 1Gi livenessProbe: httpGet: path: / port: http initialDelaySeconds: 30 periodSeconds: 30 readinessProbe: httpGet: path: / port: http initialDelaySeconds: 5 periodSeconds: 10 volumeMounts: - name: config mountPath: /config - name: tvseries mountPath: /mnt/tvseries - name: exportarr image: ghcr.io/onedr0p/exportarr:latest imagePullPolicy: IfNotPresent args: ["sonarr"] ports: - name: metrics containerPort: 9707 protocol: TCP env: - name: TZ value: Australia/Sydney - name: PORT value: "9707" - name: URL value: "http://localhost:8989" - name: API_KEY valueFrom: secretKeyRef: name: sonarr-secrets key: apitoken resources: requests: cpu: 50m memory: 128Mi limits: cpu: 250m memory: 256Mi securityContext: runAsUser: 1000 runAsGroup: 1000 runAsNonRoot: true livenessProbe: httpGet: path: /metrics port: metrics initialDelaySeconds: 30 periodSeconds: 30 readinessProbe: httpGet: path: /metrics port: metrics initialDelaySeconds: 5 periodSeconds: 10 volumeMounts: - name: config mountPath: /config readOnly: true volumes: - name: config persistentVolumeClaim: claimName: sonarr-config - name: config-template configMap: name: sonarr-config-xml - name: tvseries persistentVolumeClaim: claimName: tvseries