feat: migrate immich to k8s

This commit is contained in:
cătălin 2026-08-03 21:06:07 +02:00
commit 3d3ea948db
No known key found for this signature in database
21 changed files with 1044 additions and 100 deletions

View file

@ -0,0 +1,70 @@
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.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "immich.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: machine-learning
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "immich.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: machine-learning
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}-machine-learning
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.machineLearningImage.repository }}:{{ .Values.machineLearningImage.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.machineLearningImage.pullPolicy }}
ports:
- name: http
containerPort: 3003
protocol: TCP
env:
- name: IMMICH_PORT
value: {{ .Values.service.port | quote }}
- name: IMMICH_MACHINE_LEARNING_PORT
value: "3003"
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: model-cache
mountPath: /cache
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
restartPolicy: Always
automountServiceAccountToken: false
volumes:
- name: model-cache
persistentVolumeClaim:
claimName: {{ include "immich.fullname" . }}-model-cache