Files
omnex/deploy/chart-vitrine/backend/templates/deployment.yaml
T
Xor290 8d857faa45
ci-api / test (push) Successful in 23m32s
ci-web / test (push) Successful in 14m7s
chore: build
2026-09-20 18:52:09 +02:00

91 lines
3.2 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "backend.fullname" . }}
labels:
{{- include "backend.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
{{- if or .Values.persistence.uploads.enabled .Values.persistence.verification.enabled }}
# Volumes ReadWriteOnce : un rolling update bloquerait (l'ancien Pod garde le
# volume, le nouveau ne peut pas le monter).
strategy:
type: Recreate
{{- end }}
selector:
matchLabels:
{{- include "backend.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "backend.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/app/api"]
ports:
- name: http
containerPort: {{ .Values.env.PORT | int }}
protocol: TCP
envFrom:
- configMapRef:
name: {{ include "backend.fullname" . }}
- secretRef:
name: {{ include "backend.secretName" . }}
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
{{- if .Values.persistence.uploads.enabled }}
- name: uploads
mountPath: {{ .Values.env.MEDIA_LOCAL_DIR }}
{{- end }}
{{- if .Values.persistence.verification.enabled }}
- name: verification
mountPath: {{ .Values.env.VERIFICATION_UPLOAD_DIR }}
{{- end }}
volumes:
{{- if .Values.persistence.uploads.enabled }}
- name: uploads
persistentVolumeClaim:
claimName: {{ include "backend.fullname" . }}-uploads
{{- end }}
{{- if .Values.persistence.verification.enabled }}
- name: verification
persistentVolumeClaim:
claimName: {{ include "backend.fullname" . }}-verification
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}