{{- if .Values.machineLearning.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "immich-machine-learning.name" . }} labels: {{- include "immich-machine-learning.labels" . | nindent 4 }} spec: replicas: {{ .Values.machineLearning.replicaCount }} selector: matchLabels: {{- include "immich-machine-learning.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.machineLearning.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "immich-machine-learning.labels" . | nindent 8 }} {{- with .Values.machineLearning.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "immich.serviceAccountName" . }} securityContext: {{- toYaml .Values.machineLearning.podSecurityContext | nindent 8 }} containers: - name: immich-machine-learning image: "{{ .Values.machineLearning.image.repository }}:{{ .Values.machineLearning.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.machineLearning.image.pullPolicy }} ports: - name: http containerPort: {{ .Values.machineLearning.service.port }} protocol: TCP env: {{- if .Values.machineLearning.cache.enabled }} - name: TRANSFORMERS_CACHE_DIR value: /cache {{- end }} {{- if .Values.machineLearning.env }} {{- toYaml .Values.machineLearning.env | nindent 12 }} {{- end }} securityContext: {{- toYaml .Values.machineLearning.securityContext | nindent 12 }} livenessProbe: httpGet: port: http path: /ping resources: {{- toYaml .Values.machineLearning.resources | nindent 12 }} volumeMounts: {{- if .Values.machineLearning.cache.enabled }} - mountPath: /cache name: model-cache {{- end }} {{- with .Values.machineLearning.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} volumes: {{- if .Values.machineLearning.cache.enabled }} - name: model-cache emptyDir: {{- if .Values.machineLearning.cache.useMemory }} medium: Memory {{- end }} sizeLimit: {{ .Values.machineLearning.cache.sizeLimit }} {{- end }} {{- with .Values.machineLearning.volumes }} {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.machineLearning.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.machineLearning.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.machineLearning.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- end }}