apiVersion: apps/v1
kind: Deployment
metadata:
  name: radarr
  namespace: stack-arr
spec:
  replicas: 1
  selector:
    matchLabels:
      app: radarr
  template:
    metadata:
      labels:
        app: radarr
    spec:
      imagePullSecrets:
      - name: regcred
      containers:
      - name: radarr
        image: lscr.io/linuxserver/radarr:5.28.0
        securityContext:
          capabilities:
            add:
              - NET_ADMIN
        ports:
          - containerPort: 7878
            name: webui
        env:
        - name: PUID
          value: "1013"
        - name: PGID
          value: "1013"
        - name: TZ
          value: 'Etc/UTC'
        - name: RADARR__POSTGRES__HOST
          value: 'stolon-proxy-service.postgresql.svc.cluster.local'
        - name: RADARR__POSTGRES__USER
          valueFrom:
            secretKeyRef:
              name: radarr-secret
              key: username
        - name: RADARR__POSTGRES__PASSWORD
          valueFrom:
            secretKeyRef:
              name: radarr-secret
              key: password
        - name: RADARR__POSTGRES__MAINDB
          valueFrom:
            secretKeyRef:
              name: radarr-secret
              key: maindb
        - name: RADARR__POSTGRES__LOGDB
          valueFrom:
            secretKeyRef:
              name: radarr-secret
              key: logsdb
        volumeMounts:
        - name: config
          mountPath: /config
        - name: downloads
          mountPath: /downloads
        - name: movie
          mountPath: /movie
      volumes:
      - name: config
        persistentVolumeClaim:
          claimName: radarr-config-pvc
      - name: downloads
        persistentVolumeClaim:
          claimName: qbittorrent-downloads-pvc
      - name: movie
        persistentVolumeClaim:
          claimName: radarr-movie-pvc


