--- apiVersion: apps/v1 kind: Deployment metadata: name: radarr namespace: arrstack spec: replicas: 1 strategy: # RWO config PVC + single stateful SQLite DB: never run two pods at once. type: Recreate selector: matchLabels: app: radarr template: metadata: labels: app: radarr spec: securityContext: fsGroup: 1000 fsGroupChangePolicy: OnRootMismatch initContainers: # Enforce the Vault-sourced API key and the reverse-proxy URL base in # /config/config.xml before the app starts. Vault is source of truth # (override bootstrap): the key is minted in Vault, synced by VSO into the # radarr-apikey Secret, and written here. UrlBase=/radarr lets arrproxy # forward arrstack.unkin.net/radarr/... with the prefix preserved (no 307). # Runs as root to fix ownership; touches only and . - name: apikey-init image: artifactapi.k8s.syd1.au.unkin.net/dockerhub/library/busybox:1.37.0 imagePullPolicy: IfNotPresent securityContext: runAsUser: 0 env: - name: API_KEY valueFrom: secretKeyRef: name: radarr-apikey key: apitoken command: - sh - -c - | set -eu case "$API_KEY" in "" | *[!0-9a-fA-F]*) echo "config-init: API_KEY missing or not hex; refusing" >&2 exit 1 ;; esac URL_BASE=/radarr CFG=/config/config.xml if [ ! -f "$CFG" ]; then printf '\n %s\n %s\n\n' "$API_KEY" "$URL_BASE" > "$CFG" else if grep -q '' "$CFG"; then sed -i "s|[^<]*|${API_KEY}|" "$CFG" else sed -i "s||\n ${API_KEY}|" "$CFG" fi if grep -q '' "$CFG"; then sed -i "s|[^<]*|${URL_BASE}|" "$CFG" else sed -i "s||\n ${URL_BASE}|" "$CFG" fi fi chown 1000:1000 "$CFG" chmod 600 "$CFG" echo "config-init: and =${URL_BASE} enforced from Vault" resources: requests: cpu: 50m memory: 32Mi limits: cpu: 200m memory: 64Mi volumeMounts: - name: config mountPath: /config containers: - name: radarr image: artifactapi.k8s.syd1.au.unkin.net/dockerhub/linuxserver/radarr:6.3.0 imagePullPolicy: IfNotPresent ports: - name: http containerPort: 7878 protocol: TCP env: - name: PUID value: "1000" - name: PGID value: "1000" - name: TZ value: Australia/Sydney livenessProbe: httpGet: path: /radarr/ping port: http initialDelaySeconds: 30 periodSeconds: 30 timeoutSeconds: 5 failureThreshold: 3 readinessProbe: httpGet: path: /radarr/ping port: http initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 3 resources: requests: cpu: 100m memory: 256Mi limits: cpu: "1" memory: 1Gi volumeMounts: - name: config mountPath: /config - name: media-movies mountPath: /media/movies volumes: - name: config persistentVolumeClaim: claimName: radarr-config - name: media-movies persistentVolumeClaim: claimName: media-movies