fukuops/k8s/charts/immich/templates/statefulset.yaml

72 lines
2.5 KiB
YAML

{{- if .Values.machineLearning.enabled -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "immich.fullname" . }}-machine-learning
labels:
{{- include "immich.labels" . | nindent 4 }}
app.kubernetes.io/component: machine-learning
spec:
serviceName: {{ include "immich.fullname" . }}-machine-learning-headless
{{- if not .Values.machineLearning.autoscaling.enabled }}
replicas: {{ .Values.machineLearning.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "immich.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: machine-learning
template:
metadata:
{{- with .Values.machineLearning.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "immich.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: machine-learning
spec:
{{- with .Values.machineLearning.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.machineLearning.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}-machine-learning
securityContext:
{{- toYaml .Values.machineLearning.securityContext | nindent 12 }}
image: "{{ .Values.machineLearning.image.repository }}:{{ .Values.machineLearning.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.machineLearning.image.pullPolicy }}
ports:
- name: http
containerPort: 3003
protocol: TCP
env:
- name: IMMICH_PORT
value: {{ .Values.machineLearning.service.port | quote }}
- name: IMMICH_MACHINE_LEARNING_PORT
value: "3003"
resources:
{{- toYaml .Values.machineLearning.resources | nindent 12 }}
volumeMounts:
- name: model-cache
mountPath: /cache
{{- 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 }}
restartPolicy: Always
automountServiceAccountToken: false
volumes:
- name: model-cache
persistentVolumeClaim:
claimName: {{ include "immich.fullname" . }}-model-cache
{{- end }}