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-4.6.2
  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: default
      automountServiceAccountToken: true
      hostIPC: false
      hostNetwork: false
      hostPID: false
      dnsPolicy: ClusterFirst
      containers:
        - env:
            - name: TZ
              value: US/Central
            - 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-apprise-config
          image: caronc/apprise:v1.3.1
          imagePullPolicy: IfNotPresent
          name: apprise-api
          resources:
            requests:
              cpu: 10m
              memory: 128Mi
        - env:
            - name: TZ
              value: US/Central
          image: ghcr.io/advplyr/audiobookshelf:2.32.1
          imagePullPolicy: IfNotPresent
          name: main
          resources:
            requests:
              cpu: 10m
              memory: 128Mi
          volumeMounts:
            - mountPath: /mnt/store/
              name: audiobooks
            - mountPath: /config
              name: config
            - mountPath: /metadata
              name: metadata
      volumes:
        - name: audiobooks
          persistentVolumeClaim:
            claimName: audiobookshelf-nfs-storage
        - name: config
          persistentVolumeClaim:
            claimName: audiobookshelf-config
        - name: metadata
          persistentVolumeClaim:
            claimName: audiobookshelf-metadata
