@@ -20,16 +20,20 @@ metadata:
2020 name : {{ include "kubernetes-ingress.crdjob.fullname" . }}
2121 namespace : {{ include "kubernetes-ingress.namespace" . }}
2222 labels :
23- app.kubernetes.io/name : {{ include "kubernetes-ingress.name " . }}
23+ app.kubernetes.io/name : {{ include "kubernetes-ingress.crdjob.fullname " . }}
2424 helm.sh/chart : {{ include "kubernetes-ingress.chart" . }}
2525 app.kubernetes.io/managed-by : {{ .Release.Service }}
2626 app.kubernetes.io/instance : {{ .Release.Name }}
2727 app.kubernetes.io/version : {{ .Chart.AppVersion }}
2828spec :
29+ {{- if .Capabilities.APIVersions.Has "batch/v1alpha1" }}
30+ ttlSecondsAfterFinished : 0
31+ {{- end }}
32+ backoffLimit : 0
2933 template :
3034 metadata :
3135 labels :
32- app.kubernetes.io/name : {{ include "kubernetes-ingress.name " . }}
36+ app.kubernetes.io/name : {{ include "kubernetes-ingress.crdjob.fullname " . }}
3337 app.kubernetes.io/instance : {{ .Release.Name }}
3438 {{- if .Values.controller.podLabels }}
3539{{ toYaml .Values.controller.podLabels | indent 8 }}
@@ -39,13 +43,63 @@ spec:
3943{{ toYaml .Values.controller.podAnnotations | indent 8 }}
4044 {{- end }}
4145 spec :
46+ restartPolicy : Never
4247 serviceAccountName : {{ include "kubernetes-ingress.serviceAccountName" . }}
48+ {{- if .Values.controller.imageCredentials.registry }}
49+ imagePullSecrets :
50+ - name : {{ include "kubernetes-ingress.fullname" . }}
51+ {{- else if .Values.controller.existingImagePullSecret }}
52+ imagePullSecrets :
53+ - name : {{ .Values.controller.existingImagePullSecret }}
54+ {{- end }}
55+ {{- if .Values.controller.priorityClassName }}
56+ priorityClassName : {{ .Values.controller.priorityClassName }}
57+ {{- end }}
58+ {{- if .Values.controller.runtimeClassName }}
59+ runtimeClassName : {{ .Values.controller.runtimeClassName }}
60+ {{- end }}
61+ {{- if .Values.controller.unprivileged }}
62+ securityContext :
63+ runAsNonRoot : true
64+ runAsUser : 1000
65+ runAsGroup : 1000
66+ {{- end }}
4367 containers :
44- - name : {{ include "kubernetes-ingress.name" . }}-{{ .Values.controller.name }}
68+ - name : crd
4569 image : " {{ .Values.controller.image.repository }}:{{ tpl .Values.controller.image.tag . }}"
4670 imagePullPolicy : {{ .Values.controller.image.pullPolicy }}
4771 command :
4872 - /haproxy-ingress-controller
4973 - --job-check-crd
50- restartPolicy : Never
51- backoffLimit : 0
74+ {{- if .Values.controller.unprivileged }}
75+ securityContext :
76+ runAsNonRoot : true
77+ runAsUser : 1000
78+ runAsGroup : 1000
79+ allowPrivilegeEscalation : {{ .Values.controller.allowPrivilegeEscalation }}
80+ capabilities :
81+ drop :
82+ - ALL
83+ add :
84+ - NET_BIND_SERVICE
85+ {{- if .Values.controller.enableRuntimeDefaultSeccompProfile }}
86+ seccompProfile :
87+ type : RuntimeDefault
88+ {{- end }}
89+ {{- end }}
90+ {{- with.Values.controller.initContainers }}
91+ initContainers :
92+ {{- toYaml . | nindent 8 }}
93+ {{- end }}
94+ {{- with .Values.controller.nodeSelector }}
95+ nodeSelector :
96+ {{- toYaml . | nindent 8 }}
97+ {{- end }}
98+ {{- with .Values.controller.affinity }}
99+ affinity :
100+ {{- toYaml . | nindent 8 }}
101+ {{- end }}
102+ {{- with .Values.controller.tolerations }}
103+ tolerations :
104+ {{- toYaml . | nindent 8 }}
105+ {{- end }}
0 commit comments