apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: photoprism
  name: photoprism
spec:
  selector:
    matchLabels:
      app: photoprism
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: photoprism
    spec:
      nodeSelector:
        kubernetes.io/hostname: k3sh0
      containers:
        - name: photoprism
          image: photoprism/photoprism:latest
          imagePullPolicy: Always
          resources:
            limits:
              cpu: "750m"
              memory: "4096Mi"
            requests:
              cpu: "125m"
              memory: "512Mi"
          ports:
            - containerPort: 2342
          env:
            - name: PHOTOPRISM_ADMIN_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: prism-credentials
                  key: admin_password
            - name: PHOTOPRISM_SITE_URL
              value: "https://photos.t00n.de"
            - name: PHOTOPRISM_ORIGINALS_LIMIT
              value: "5000"
            - name: PHOTOPRISM_HTTP_COMPRESSION
              value: gzip
            - name: PHOTOPRISM_LOG_LEVEL
              value: error
            - name: PHOTOPRISM_PUBLIC
              value: "false"
            - name: PHOTOPRISM_READONLY
              value: "false"
            - name: PHOTOPRISM_EXPERIMENTAL
              value: "false"
            - name: PHOTOPRISM_DISABLE_CHOWN
              value: "false"
            - name: PHOTOPRISM_DISABLE_WEBDAV
              value: "true"
            - name: PHOTOPRISM_DISABLE_SETTINGS
              value: "true"
            - name: PHOTOPRISM_DISABLE_TENSORFLOW
              value: "false"
            - name: PHOTOPRISM_DISABLE_FACES
              value: "false"
            - name: PHOTOPRISM_DISABLE_CLASSIFICATION
              value: "false"
            - name: PHOTOPRISM_DISABLE_RAW
              value: "false"
            - name: PHOTOPRISM_RAW_PRESETS
              value: "false"
            - name: PHOTOPRISM_JPEG_QUALITY
              value: "85"
            - name: PHOTOPRISM_DETECT_NSFW
              value: "true"
            - name: PHOTOPRISM_UPLOAD_NSFW
              value: "true"
            #- name: PHOTOPRISM_FFMPEG_ENCODER
            #  value: "intel"
            #- name: PHOTOPRISM_INIT
            #  value: "intel tensorflow"
            - name: PHOTOPRISM_SITE_CAPTION
              value: ""
            - name: PHOTOPRISM_SITE_DESCRIPTION
              value: ""
            - name: PHOTOPRISM_SITE_AUTHOR
              value: ""
            - name: PHOTOPRISM_UID
              value: "1000"
            - name: PHOTOPRISM_GID
              value: "1000"
          volumeMounts:
            - mountPath: /photoprism/originals
              name: originals
            - mountPath: /photoprism/storage
              name: storage
        - name: redis
          image: redis:6-alpine
          resources:
            limits:
              cpu: "500m"
              memory: "1024Mi"
            requests:
              cpu: "125m"
              memory: "265Mi"
      volumes:
        - name: originals
          hostPath:
            path: /mnt/longhorn1/svc/photoprism/main/photoprism/originals
            type: Directory
        - name: storage
          hostPath:
            path: /mnt/longhorn1/svc/photoprism/main/photoprism/storage
            type: Directory
