Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a092fe-13b1-7f12-ac74-7d258af4d79c
117 lines
4.6 KiB
YAML
117 lines
4.6 KiB
YAML
{{- include "vergabe.validatePilot" . }}
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "vergabe.fullname" . }}
|
|
labels: {{- include "vergabe.labels" . | nindent 4 }}
|
|
spec:
|
|
replicas: {{ .Values.replicaCount }}
|
|
selector:
|
|
matchLabels: {{- include "vergabe.selectorLabels" . | nindent 6 }}
|
|
strategy:
|
|
{{- if or .Values.persistence.media.enabled .Values.persistence.appState.enabled }}
|
|
type: Recreate
|
|
{{- else }}
|
|
type: RollingUpdate
|
|
rollingUpdate:
|
|
maxSurge: 1
|
|
maxUnavailable: 0
|
|
{{- end }}
|
|
template:
|
|
metadata:
|
|
labels: {{- include "vergabe.selectorLabels" . | nindent 8 }}
|
|
spec:
|
|
automountServiceAccountToken: false
|
|
securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
{{- if .Values.migrations.enabled }}
|
|
initContainers:
|
|
- name: migrate
|
|
image: {{ include "vergabe.image" . | quote }}
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
command: ["python", "manage.py", "migrate", "--noinput"]
|
|
securityContext: {{- toYaml .Values.securityContext | nindent 12 }}
|
|
envFrom:
|
|
- secretRef:
|
|
name: {{ .Values.envSecretName | quote }}
|
|
env:
|
|
{{- range $k, $v := .Values.env }}
|
|
- name: {{ $k }}
|
|
value: {{ $v | quote }}
|
|
{{- end }}
|
|
resources: {{- toYaml .Values.resources | nindent 12 }}
|
|
{{- end }}
|
|
containers:
|
|
- name: app
|
|
image: {{ include "vergabe.image" . | quote }}
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
securityContext: {{- toYaml .Values.securityContext | nindent 12 }}
|
|
ports:
|
|
- name: http
|
|
containerPort: {{ .Values.service.targetPort }}
|
|
protocol: TCP
|
|
envFrom:
|
|
- secretRef:
|
|
name: {{ .Values.envSecretName | quote }}
|
|
env:
|
|
{{- range $k, $v := .Values.env }}
|
|
- name: {{ $k }}
|
|
value: {{ $v | quote }}
|
|
{{- end }}
|
|
{{- if .Values.probes.enabled }}
|
|
readinessProbe:
|
|
httpGet:
|
|
path: {{ .Values.probes.path }}
|
|
port: {{ .Values.probes.port }}
|
|
httpHeaders:
|
|
- name: Host
|
|
value: {{ .Values.probes.hostHeader | quote }}
|
|
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
|
|
failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
|
|
livenessProbe:
|
|
httpGet:
|
|
path: {{ .Values.probes.path }}
|
|
port: {{ .Values.probes.port }}
|
|
httpHeaders:
|
|
- name: Host
|
|
value: {{ .Values.probes.hostHeader | quote }}
|
|
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }}
|
|
failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
|
|
{{- end }}
|
|
resources: {{- toYaml .Values.resources | nindent 12 }}
|
|
{{- if or .Values.persistence.media.enabled .Values.persistence.appState.enabled }}
|
|
volumeMounts:
|
|
{{- if .Values.persistence.media.enabled }}
|
|
- name: media
|
|
mountPath: /app/media
|
|
{{- end }}
|
|
{{- if .Values.persistence.appState.enabled }}
|
|
- name: app-state
|
|
mountPath: /app/.issue-facade
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if or .Values.persistence.media.enabled .Values.persistence.appState.enabled }}
|
|
volumes:
|
|
{{- if .Values.persistence.media.enabled }}
|
|
- name: media
|
|
persistentVolumeClaim:
|
|
claimName: {{ default (printf "%s-media" (include "vergabe.fullname" .)) .Values.persistence.media.existingClaim }}
|
|
{{- end }}
|
|
{{- if .Values.persistence.appState.enabled }}
|
|
- name: app-state
|
|
persistentVolumeClaim:
|
|
claimName: {{ default (printf "%s-app-state" (include "vergabe.fullname" .)) .Values.persistence.appState.existingClaim }}
|
|
{{- end }}
|
|
{{- 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 }}
|