apiVersion: apps/v1
kind: Deployment
metadata:
  name: audiobookshelf
  labels:
    app.kubernetes.io/controller: main
    app.kubernetes.io/instance: audiobookshelf
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: audiobookshelf
    helm.sh/chart: audiobookshelf-5.0.1
  namespace: audiobookshelf
spec:
  revisionHistoryLimit: 3
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/controller: main
      app.kubernetes.io/name: audiobookshelf
      app.kubernetes.io/instance: audiobookshelf
  template:
    metadata:
      labels:
        app.kubernetes.io/controller: main
        app.kubernetes.io/instance: audiobookshelf
        app.kubernetes.io/name: audiobookshelf
    spec:
      enableServiceLinks: false
      serviceAccountName: audiobookshelf
      automountServiceAccountToken: false
      securityContext:
        fsGroup: 1000
        fsGroupChangePolicy: OnRootMismatch
        runAsGroup: 1000
        runAsUser: 1000
      hostIPC: false
      hostNetwork: false
      hostPID: false
      dnsPolicy: ClusterFirst
      containers:
        - env:
            - name: TZ
              value: America/Chicago
            - name: PGID
              value: "1000"
            - name: PUID
              value: "1000"
            - name: APPRISE_STORAGE_MODE
              value: memory
            - name: APPRISE_STATEFUL_MODE
              value: disabled
            - name: APPRISE_WORKER_COUNT
              value: "1"
            - name: APPRISE_STATELESS_URLS
              valueFrom:
                secretKeyRef:
                  key: ntfy-url
                  name: audiobookshelf-config-apprise
          image: ghcr.io/caronc/apprise:v1.4.1@sha256:25e0577915c2f06233ae1dce077f05c0fc9ba4f0ea89de5aee18a32b2ee9a75c
          name: apprise-api
        - env:
            - name: TZ
              value: America/Chicago
          image: ghcr.io/advplyr/audiobookshelf:2.35.0@sha256:89276ff2e0b3d2f07dd334b641f27a34ab7f02e1047c60b7b8a30126cb0813a5
          name: main
          resources:
            requests:
              cpu: 1m
              memory: 200Mi
          volumeMounts:
            - mountPath: /mnt/store/Audiobooks
              name: audiobooks
            - mountPath: /mnt/store/Books
              name: books
            - mountPath: /config
              name: config
            - mountPath: /metadata
              name: metadata
            - mountPath: /mnt/store/Podcasts
              name: podcasts
      volumes:
        - name: audiobooks
          persistentVolumeClaim:
            claimName: audiobookshelf-audiobooks-nfs-storage
        - name: books
          persistentVolumeClaim:
            claimName: audiobookshelf-books-nfs-storage
        - name: config
          persistentVolumeClaim:
            claimName: audiobookshelf-config
        - name: metadata
          persistentVolumeClaim:
            claimName: audiobookshelf-metadata
        - name: podcasts
          persistentVolumeClaim:
            claimName: audiobookshelf-podcasts-nfs-storage
