apiVersion: v1 kind: Service metadata: name: immich-machine-learning namespace: immich spec: selector: app: immich-machine-learning ports: - name: http port: 3003 targetPort: 3003 --- apiVersion: apps/v1 kind: Deployment metadata: annotations: reloader.stakater.com/auto: "true" name: immich-machine-learning-deployment namespace: immich labels: app: immich-machine-learning spec: replicas: 1 selector: matchLabels: app: immich-machine-learning strategy: type: Recreate template: metadata: labels: app: immich-machine-learning spec: containers: - name: immich-machine-learning image: ghcr.io/immich-app/immich-machine-learning:v3 envFrom: - configMapRef: name: immich-config - secretRef: name: immich-secrets ports: - name: http containerPort: 3003 volumeMounts: - name: model-cache mountPath: /cache # The first request pulls a model over the internet, so a cold start # is slower than a container start. startupProbe: httpGet: path: /ping port: http failureThreshold: 60 periodSeconds: 5 timeoutSeconds: 5 readinessProbe: httpGet: path: /ping port: http periodSeconds: 10 timeoutSeconds: 5 livenessProbe: httpGet: path: /ping port: http initialDelaySeconds: 30 periodSeconds: 30 timeoutSeconds: 5 # Same reasoning as the server: the request covers the idle cost # only, because the node has no spare cores to schedule against. # Recognition is the burst - a busy import wants both cores. resources: requests: cpu: "100m" memory: "1Gi" limits: cpu: "2000m" memory: "3Gi" volumes: - name: model-cache persistentVolumeClaim: claimName: immich-model-cache-pvc --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: immich-model-cache-pvc namespace: immich spec: accessModes: - ReadWriteOnce resources: requests: storage: 2Gi