apiVersion: apps/v1
kind: Deployment
metadata:
  name: decluttarr
  namespace: stack-arr
spec:
  replicas: 1
  selector:
    matchLabels:
      app: decluttarr
  template:
    metadata:
      labels:
        app: decluttarr
    spec:
      imagePullSecrets:
      - name: regcred
      containers:
      - name: decluttarr
        image: ghcr.io/manimatter/decluttarr:v1.50.2
        env:
            - name: LOG_LEVEL
              value: VERBOSE
            - name: REMOVE_TIMER
              value: '3'
            - name: REMOVE_FAILED
              value: 'True'
            - name: REMOVE_FAILED_IMPORTS
              value: 'False'
            - name: REMOVE_METADATA_MISSING
              value: 'True'
            - name: REMOVE_MISSING_FILES
              value: 'True'
            - name: REMOVE_ORPHANS
              value: 'True'
            - name: REMOVE_SLOW
              value: 'False'
            - name: REMOVE_STALLED
              value: 'True'
            - name: REMOVE_UNMONITORED
              value: 'False'
            - name: MIN_DOWNLOAD_SPEED
              value: '100'
            - name: PERMITTED_ATTEMPTS
              value: '3'
            - name: SONARR_URL
              value: http://sonarr-service.stack-arr.svc.cluster.local:8989
            - name: SONARR_KEY
              valueFrom:
                secretKeyRef:
                  name: decluttarr-secret
                  key: sonarrkey
            - name: QBITTORRENT_URL
              value: http://qbittorrent-service.stack-arr.svc.cluster.local:8080
            - name: QBITTORRENT_USERNAME
              valueFrom:
                secretKeyRef:
                  name: decluttarr-secret
                  key: qbittorrentuser
            - name: QBITTORRENT_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: decluttarr-secret
                  key: qbittorrentpass
        volumeMounts:
        - name: config
          mountPath: /config
        - name: downloads
          mountPath: /data/downloads
      volumes:
      - name: config
        persistentVolumeClaim:
          claimName: decluttarr-config-pvc
      - name: downloads
        persistentVolumeClaim:
          claimName: qbittorrent-downloads-pvc



