apiVersion: apps/v1
kind: Deployment
metadata:
  name: music-grabber
  labels:
    app.kubernetes.io/controller: main
    app.kubernetes.io/instance: music-grabber
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: music-grabber
    helm.sh/chart: music-grabber-5.0.1
  namespace: music-grabber
spec:
  revisionHistoryLimit: 3
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/controller: main
      app.kubernetes.io/name: music-grabber
      app.kubernetes.io/instance: music-grabber
  template:
    metadata:
      labels:
        app.kubernetes.io/controller: main
        app.kubernetes.io/instance: music-grabber
        app.kubernetes.io/name: music-grabber
    spec:
      enableServiceLinks: false
      serviceAccountName: music-grabber
      automountServiceAccountToken: false
      securityContext:
        fsGroup: 1000
        fsGroupChangePolicy: OnRootMismatch
      hostIPC: false
      hostNetwork: false
      hostPID: false
      dnsPolicy: ClusterFirst
      containers:
        - env:
            - name: MUSIC_DIR
              value: /mnt/store/Music Grabber/
            - name: ENABLE_MUSICBRAINZ
              value: "true"
            - name: ORGANISE_BY_ARTIST
              value: "true"
            - name: NAVIDROME_URL
              value: http://navidrome-main.navidrome:80
            - name: NAVIDROME_USER
              valueFrom:
                secretKeyRef:
                  key: navidrome-user
                  name: music-grabber-config
            - name: NAVIDROME_PASS
              valueFrom:
                secretKeyRef:
                  key: navidrome-password
                  name: music-grabber-config
            - name: SLSKD_URL
              value: http://slskd.slskd:5030
            - name: SLSKD_USER
              valueFrom:
                secretKeyRef:
                  key: slskd-user
                  name: music-grabber-config
            - name: SLSKD_PASS
              valueFrom:
                secretKeyRef:
                  key: slskd-password
                  name: music-grabber-config
            - name: SLSKD_DOWNLOADS_PATH
              value: /mnt/store/slskd/Downloads
          image: g33kphr33k/musicgrabber:2.8.13@sha256:9895b8d50a732248a3ceec611c8db15d08d46438b5a3cc7932c5fa7fe2f8a6d2
          name: main
          resources:
            limits:
              cpu: 100m
            requests:
              cpu: 10m
              memory: 50Mi
          volumeMounts:
            - mountPath: /data
              name: data
            - mountPath: /mnt/store/
              name: music
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: music-grabber-data
        - name: music
          persistentVolumeClaim:
            claimName: music-grabber-nfs-storage
