2023-02-15 01:25:36 +00:00
|
|
|
{{- /*
|
|
|
|
The pod definition included in the controller.
|
|
|
|
*/ -}}
|
|
|
|
{{- define "backend.controller.pod" -}}
|
2023-04-18 22:53:54 +00:00
|
|
|
{{- with .Values.backend.imagePullSecrets }}
|
2023-02-15 01:25:36 +00:00
|
|
|
imagePullSecrets:
|
|
|
|
{{- toYaml . | nindent 2 }}
|
|
|
|
{{- end }}
|
|
|
|
serviceAccountName: {{ include "backend.names.serviceAccountName" . }}
|
|
|
|
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
|
2023-04-18 22:53:54 +00:00
|
|
|
{{- with .Values.backend.podSecurityContext }}
|
2023-02-15 01:25:36 +00:00
|
|
|
securityContext:
|
|
|
|
{{- toYaml . | nindent 2 }}
|
|
|
|
{{- end }}
|
2023-04-18 22:53:54 +00:00
|
|
|
{{- with .Values.backend.priorityClassName }}
|
2023-02-15 01:25:36 +00:00
|
|
|
priorityClassName: {{ . }}
|
|
|
|
{{- end }}
|
2023-04-18 22:53:54 +00:00
|
|
|
{{- with .Values.backend.runtimeClassName }}
|
2023-02-15 01:25:36 +00:00
|
|
|
runtimeClassName: {{ . }}
|
|
|
|
{{- end }}
|
2023-04-18 22:53:54 +00:00
|
|
|
{{- with .Values.backend.schedulerName }}
|
2023-02-15 01:25:36 +00:00
|
|
|
schedulerName: {{ . }}
|
|
|
|
{{- end }}
|
2023-04-18 22:53:54 +00:00
|
|
|
{{- with .Values.backend.hostNetwork }}
|
2023-02-15 01:25:36 +00:00
|
|
|
hostNetwork: {{ . }}
|
|
|
|
{{- end }}
|
2023-04-18 22:53:54 +00:00
|
|
|
{{- with .Values.backend.hostname }}
|
2023-02-15 01:25:36 +00:00
|
|
|
hostname: {{ . }}
|
|
|
|
{{- end }}
|
2023-04-18 22:53:54 +00:00
|
|
|
{{- if .Values.backend.dnsPolicy }}
|
|
|
|
dnsPolicy: {{ .Values.backend.dnsPolicy }}
|
|
|
|
{{- else if .Values.backend.hostNetwork }}
|
2023-02-15 01:25:36 +00:00
|
|
|
dnsPolicy: ClusterFirstWithHostNet
|
|
|
|
{{- else }}
|
|
|
|
dnsPolicy: ClusterFirst
|
|
|
|
{{- end }}
|
2023-04-18 22:53:54 +00:00
|
|
|
{{- with .Values.backend.dnsConfig }}
|
2023-02-15 01:25:36 +00:00
|
|
|
dnsConfig:
|
|
|
|
{{- toYaml . | nindent 2 }}
|
|
|
|
{{- end }}
|
2023-04-18 22:53:54 +00:00
|
|
|
enableServiceLinks: {{ .Values.backend.enableServiceLinks }}
|
2023-02-15 01:25:36 +00:00
|
|
|
{{- with .Values.termination.gracePeriodSeconds }}
|
|
|
|
terminationGracePeriodSeconds: {{ . }}
|
|
|
|
{{- end }}
|
2023-04-18 22:53:54 +00:00
|
|
|
{{- if .Values.backend.initContainers }}
|
2023-02-15 01:25:36 +00:00
|
|
|
initContainers:
|
|
|
|
{{- $initContainers := list }}
|
2023-04-18 22:53:54 +00:00
|
|
|
{{- range $index, $key := (keys .Values.backend.initContainers | uniq | sortAlpha) }}
|
2023-07-21 03:00:40 +00:00
|
|
|
{{- $container := get $.Values.backend.initContainers $key }}
|
2023-02-15 01:25:36 +00:00
|
|
|
{{- if not $container.name -}}
|
|
|
|
{{- $_ := set $container "name" $key }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if $container.env -}}
|
|
|
|
{{- $_ := set $ "ObjectValues" (dict "env" $container.env) -}}
|
|
|
|
{{- $newEnv := fromYaml (include "common.controller.env_vars" $) -}}
|
|
|
|
{{- $_ := unset $.ObjectValues "env" -}}
|
|
|
|
{{- $_ := set $container "env" $newEnv.env }}
|
|
|
|
{{- end }}
|
|
|
|
{{- $initContainers = append $initContainers $container }}
|
|
|
|
{{- end }}
|
|
|
|
{{- tpl (toYaml $initContainers) $ | nindent 2 }}
|
|
|
|
{{- end }}
|
|
|
|
containers:
|
|
|
|
{{- include "backend.controller.mainContainer" . | nindent 2 }}
|
2024-04-05 05:08:46 +00:00
|
|
|
{{- if .Values.backend.additionalContainers }}
|
2023-02-15 01:25:36 +00:00
|
|
|
{{- $additionalContainers := list }}
|
2024-04-05 05:08:46 +00:00
|
|
|
{{- range $index, $key := (keys .Values.backend.additionalContainers | uniq | sortAlpha) }}
|
|
|
|
{{- $container := get $.Values.backend.initContainers $key }}
|
2023-02-15 01:25:36 +00:00
|
|
|
{{- if not $container.name -}}
|
2024-04-05 05:30:13 +00:00
|
|
|
{{- $_ := set $container "name" $key }}
|
2023-02-15 01:25:36 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- if $container.env -}}
|
|
|
|
{{- $_ := set $ "ObjectValues" (dict "env" $container.env) -}}
|
|
|
|
{{- $newEnv := fromYaml (include "backend.controller.env_vars" $) -}}
|
|
|
|
{{- $_ := set $container "env" $newEnv.env }}
|
|
|
|
{{- $_ := unset $.ObjectValues "env" -}}
|
|
|
|
{{- end }}
|
|
|
|
{{- $additionalContainers = append $additionalContainers $container }}
|
|
|
|
{{- end }}
|
|
|
|
{{- tpl (toYaml $additionalContainers) $ | nindent 2 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with (include "backend.controller.volumes" . | trim) }}
|
|
|
|
volumes:
|
|
|
|
{{- nindent 2 . }}
|
|
|
|
{{- end }}
|
2023-04-18 22:53:54 +00:00
|
|
|
{{- with .Values.backend.hostAliases }}
|
2023-02-15 01:25:36 +00:00
|
|
|
hostAliases:
|
|
|
|
{{- toYaml . | nindent 2 }}
|
|
|
|
{{- end }}
|
2023-04-18 22:53:54 +00:00
|
|
|
{{- with .Values.backend.nodeSelector }}
|
2023-02-15 01:25:36 +00:00
|
|
|
nodeSelector:
|
|
|
|
{{- toYaml . | nindent 2 }}
|
|
|
|
{{- end }}
|
2023-04-18 22:53:54 +00:00
|
|
|
{{- with .Values.backend.affinity }}
|
2023-02-15 01:25:36 +00:00
|
|
|
affinity:
|
|
|
|
{{- toYaml . | nindent 2 }}
|
|
|
|
{{- end }}
|
2023-04-18 22:53:54 +00:00
|
|
|
{{- with .Values.backend.topologySpreadConstraints }}
|
2023-02-15 01:25:36 +00:00
|
|
|
topologySpreadConstraints:
|
|
|
|
{{- toYaml . | nindent 2 }}
|
|
|
|
{{- end }}
|
2023-04-18 22:53:54 +00:00
|
|
|
{{- with .Values.backend.tolerations }}
|
2023-02-15 01:25:36 +00:00
|
|
|
tolerations:
|
|
|
|
{{- toYaml . | nindent 2 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end -}}
|