fukuops/k8s/charts/immich/templates/deployment.yaml
cătălin 1fd2bfef3d
feat(helm): complete chart normalization with ConfigMap, HPA, and OCI migration
- Added debug mode, structured ConfigMap pattern, and README to all charts
- Migrated all flat-structure charts to hierarchical values under chartname key
- Fixed templates to use correct hierarchical paths
- Renamed helm-rustical key to rustical, added HPA support
- Fixed ingress YAML parsing (oxicloud), nested env vars (rustical)
- Pushed all normalized charts to OCI registry as 1.0.0+ and updated ArgoCD apps
2026-08-14 09:35:19 +02:00

209 lines
7.6 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "immich.fullname" . }}-server
labels:
{{- include "immich.labels" . | nindent 4 }}
app.kubernetes.io/component: server
spec:
{{- if not .Values.immich.autoscaling.enabled }}
replicas: {{ .Values.immich.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "immich.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: server
strategy:
rollingUpdate:
maxSurge: 50%
maxUnavailable: 50%
type: RollingUpdate
template:
metadata:
{{- with .Values.immich.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "immich.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: server
spec:
{{- with .Values.immich.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.immich.podSecurityContext | nindent 8 }}
initContainers:
- name: init-immich
image: "{{ .Values.immich.image.repository }}:{{ .Values.immich.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: IfNotPresent
command:
- sh
- -c
- |
touch /data/library/.immich
touch /data/encoded-video/.immich
touch /data/thumbs/.immich
touch /data/upload/.immich
touch /data/profile/.immich
touch /data/backups/.immich
chown -R 10000:10000 /data/library /data/encoded-video /data/thumbs /data/upload /data/profile /data/backups
volumeMounts:
- name: library
mountPath: /data/library
- name: encoded-video
mountPath: /data/encoded-video
- name: thumbs
mountPath: /data/thumbs
- name: upload
mountPath: /data/upload
- name: profile
mountPath: /data/profile
- name: backups
mountPath: /data/backups
{{- if .Values.immich.debug.enabled }}
- name: debug
image: alpine:3.19
command: ["sleep", "infinity"]
envFrom:
{{- if .Values.immich.secret.existingSecretName }}
- secretRef:
name: {{ .Values.immich.secret.existingSecretName }}
{{- else if .Values.immich.secret.enabled }}
- secretRef:
name: {{ include "immich.fullname" . }}
{{- end }}
- configMapRef:
name: {{ include "immich.fullname" . }}-config
volumeMounts:
- name: library
mountPath: /data/library
{{- if .Values.immich.persistence.encodedVideo.enabled }}
- name: encoded-video
mountPath: /data/encoded-video
{{- end }}
{{- if .Values.immich.persistence.thumbs.enabled }}
- name: thumbs
mountPath: /data/thumbs
{{- end }}
{{- if .Values.immich.persistence.upload.enabled }}
- name: upload
mountPath: /data/upload
{{- end }}
{{- if .Values.immich.persistence.profile.enabled }}
- name: profile
mountPath: /data/profile
{{- end }}
{{- if .Values.immich.persistence.backups.enabled }}
- name: backups
mountPath: /data/backups
{{- end }}
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: false
capabilities:
drop:
- all
{{- end }}
containers:
- name: {{ .Chart.Name }}-server
securityContext:
{{- toYaml .Values.immich.securityContext | nindent 12 }}
image: "{{ .Values.immich.image.repository }}:{{ .Values.immich.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.immich.image.pullPolicy }}
envFrom:
{{- if .Values.immich.secret.existingSecretName }}
- secretRef:
name: {{ .Values.immich.secret.existingSecretName }}
{{- else if .Values.immich.secret.enabled }}
- secretRef:
name: {{ include "immich.fullname" . }}
{{- end }}
- configMapRef:
name: {{ include "immich.fullname" . }}-config
env:
- name: IMMICH_PORT
value: {{ .Values.immich.service.port | quote }}
- name: IMMICH_MACHINE_LEARNING_URL
value: {{ printf "http://%s-machine-learning:3003" (include "immich.fullname" .) | quote }}
{{- if not .Values.immich.debug.enabled }}
livenessProbe:
{{- toYaml .Values.immich.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.immich.readinessProbe | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 2283
protocol: TCP
resources:
{{- toYaml .Values.immich.resources | nindent 12 }}
volumeMounts:
- name: library
mountPath: /data/library
{{- if .Values.immich.persistence.encodedVideo.enabled }}
- name: encoded-video
mountPath: /data/encoded-video
{{- end }}
{{- if .Values.immich.persistence.thumbs.enabled }}
- name: thumbs
mountPath: /data/thumbs
{{- end }}
{{- if .Values.immich.persistence.upload.enabled }}
- name: upload
mountPath: /data/upload
{{- end }}
{{- if .Values.immich.persistence.profile.enabled }}
- name: profile
mountPath: /data/profile
{{- end }}
{{- if .Values.immich.persistence.backups.enabled }}
- name: backups
mountPath: /data/backups
{{- end }}
{{- with .Values.immich.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.immich.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.immich.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
restartPolicy: Always
automountServiceAccountToken: false
volumes:
{{- if .Values.immich.persistence.library.enabled }}
- name: library
persistentVolumeClaim:
claimName: {{ include "immich.fullname" . }}-library
{{- end }}
{{- if .Values.immich.persistence.encodedVideo.enabled }}
- name: encoded-video
persistentVolumeClaim:
claimName: {{ include "immich.fullname" . }}-encoded-video
{{- end }}
{{- if .Values.immich.persistence.thumbs.enabled }}
- name: thumbs
persistentVolumeClaim:
claimName: {{ include "immich.fullname" . }}-thumbs
{{- end }}
{{- if .Values.immich.persistence.upload.enabled }}
- name: upload
persistentVolumeClaim:
claimName: {{ include "immich.fullname" . }}-upload
{{- end }}
{{- if .Values.immich.persistence.profile.enabled }}
- name: profile
persistentVolumeClaim:
claimName: {{ include "immich.fullname" . }}-profile
{{- end }}
{{- if .Values.immich.persistence.backups.enabled }}
- name: backups
persistentVolumeClaim:
claimName: {{ include "immich.fullname" . }}-backups
{{- end }}