apiVersion: apps/v1
kind: Deployment
metadata:
  name: immich
  labels:
    app.kubernetes.io/controller: main
    app.kubernetes.io/instance: immich
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: immich
    helm.sh/chart: immich-5.0.1
  namespace: immich
spec:
  revisionHistoryLimit: 3
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/controller: main
      app.kubernetes.io/name: immich
      app.kubernetes.io/instance: immich
  template:
    metadata:
      labels:
        app.kubernetes.io/controller: main
        app.kubernetes.io/instance: immich
        app.kubernetes.io/name: immich
    spec:
      enableServiceLinks: false
      serviceAccountName: immich
      automountServiceAccountToken: true
      hostIPC: false
      hostNetwork: false
      hostPID: false
      dnsPolicy: ClusterFirst
      containers:
        - env:
            - name: TZ
              value: America/Chicago
            - name: IMMICH_TELEMETRY_INCLUDE
              value: all
            - name: IMMICH_CONFIG_FILE
              value: /config/immich.json
            - name: REDIS_HOSTNAME
              value: immich-valkey
            - name: DB_VECTOR_EXTENSION
              value: vectorchord
            - name: DB_HOSTNAME
              valueFrom:
                secretKeyRef:
                  key: host
                  name: immich-postgresql-18-cluster-app
            - name: DB_DATABASE_NAME
              valueFrom:
                secretKeyRef:
                  key: dbname
                  name: immich-postgresql-18-cluster-app
            - name: DB_PORT
              valueFrom:
                secretKeyRef:
                  key: port
                  name: immich-postgresql-18-cluster-app
            - name: DB_USERNAME
              valueFrom:
                secretKeyRef:
                  key: user
                  name: immich-postgresql-18-cluster-app
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: password
                  name: immich-postgresql-18-cluster-app
          image: ghcr.io/immich-app/immich-server:v2.7.5@sha256:c15bff75068effb03f4355997d03dc7e0fc58720c2b54ad6f7f10d1bc57efaa5
          livenessProbe:
            failureThreshold: 3
            httpGet:
              path: /api/server/ping
              port: 2283
            initialDelaySeconds: 0
            periodSeconds: 10
            timeoutSeconds: 1
          name: main
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /api/server/ping
              port: 2283
            initialDelaySeconds: 0
            periodSeconds: 10
            timeoutSeconds: 1
          resources:
            limits:
              gpu.intel.com/i915: 1
            requests:
              cpu: 10m
              gpu.intel.com/i915: 1
              memory: 500Mi
          startupProbe:
            failureThreshold: 30
            httpGet:
              path: /api/server/ping
              port: 2283
            initialDelaySeconds: 0
            periodSeconds: 10
            timeoutSeconds: 1
          volumeMounts:
            - mountPath: /config/immich.json
              mountPropagation: None
              name: config
              readOnly: true
              subPath: immich.json
            - mountPath: /usr/src/app/upload
              name: data
      volumes:
        - csi:
            driver: secrets-store.csi.k8s.io
            readOnly: true
            volumeAttributes:
              secretProviderClass: immich-config
          name: config
        - name: data
          persistentVolumeClaim:
            claimName: immich
