apiVersion: apps/v1
kind: Deployment
metadata:
  name: sonarr-4k
  labels:
    app.kubernetes.io/controller: main
    app.kubernetes.io/instance: sonarr-4k
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: sonarr-4k
    helm.sh/chart: sonarr-4k-4.6.2
  namespace: sonarr-4k
spec:
  revisionHistoryLimit: 3
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/controller: main
      app.kubernetes.io/name: sonarr-4k
      app.kubernetes.io/instance: sonarr-4k
  template:
    metadata:
      labels:
        app.kubernetes.io/controller: main
        app.kubernetes.io/instance: sonarr-4k
        app.kubernetes.io/name: sonarr-4k
    spec:
      enableServiceLinks: false
      serviceAccountName: default
      automountServiceAccountToken: true
      securityContext:
        fsGroup: 1000
        fsGroupChangePolicy: OnRootMismatch
      hostIPC: false
      hostNetwork: false
      hostPID: false
      dnsPolicy: ClusterFirst
      containers:
        - env:
            - name: TZ
              value: US/Central
            - name: PUID
              value: "1000"
            - name: PGID
              value: "1000"
          image: ghcr.io/linuxserver/sonarr:4.0.16@sha256:6f73bbba33391a338e20d836a60c86beaf2a865a89b706b339fc8cb0b8ce1559
          imagePullPolicy: IfNotPresent
          name: main
          resources:
            requests:
              cpu: 10m
              memory: 256Mi
          volumeMounts:
            - mountPath: /config
              name: config
            - mountPath: /mnt/store
              name: media
        - args:
            - sonarr
          env:
            - name: URL
              value: http://localhost
            - name: CONFIG
              value: /config/config.xml
            - name: PORT
              value: "9794"
            - name: ENABLE_ADDITIONAL_METRICS
              value: "false"
            - name: ENABLE_UNKNOWN_QUEUE_ITEMS
              value: "false"
          image: ghcr.io/onedr0p/exportarr:v2.3.0
          imagePullPolicy: IfNotPresent
          name: metrics
          resources:
            requests:
              cpu: 10m
              memory: 256Mi
          volumeMounts:
            - mountPath: /config
              name: config
              readOnly: true
      volumes:
        - name: config
          persistentVolumeClaim:
            claimName: sonarr-4k-config
        - name: media
          persistentVolumeClaim:
            claimName: sonarr-4k-nfs-storage
