2022-12-07 12:16:38 +00:00
{{- if and .Values.controller.admissionWebhooks.enabled .Values.controller.admissionWebhooks.patch.enabled (not .Values.controller.admissionWebhooks.certManager.enabled) -}}
2020-02-24 19:25:57 +00:00
apiVersion : batch/v1
kind : Job
metadata :
2023-10-29 17:26:05 +00:00
name : {{ include "ingress-nginx.admissionWebhooks.createSecretJob.fullname" . }}
2023-10-24 17:53:46 +00:00
namespace : {{ include "ingress-nginx.namespace" . }}
2020-02-24 19:25:57 +00:00
annotations :
"helm.sh/hook": pre-install,pre-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
2021-11-29 11:33:22 +00:00
{{- with .Values.controller.admissionWebhooks.annotations }}
2021-12-07 19:26:37 +00:00
{{- toYaml . | nindent 4 }}
2021-11-29 11:33:22 +00:00
{{- end }}
2020-02-24 19:25:57 +00:00
labels :
2020-02-28 14:53:24 +00:00
{{- include "ingress-nginx.labels" . | nindent 4 }}
app.kubernetes.io/component : admission-webhook
2021-11-19 14:52:52 +00:00
{{- with .Values.controller.admissionWebhooks.patch.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
2020-02-24 19:25:57 +00:00
spec :
2020-03-02 14:49:26 +00:00
{{- if .Capabilities.APIVersions.Has "batch/v1alpha1" }}
2020-02-24 19:25:57 +00:00
# Alpha feature since k8s 1.12
ttlSecondsAfterFinished : 0
2020-03-02 14:49:26 +00:00
{{- end }}
2020-02-24 19:25:57 +00:00
template :
metadata :
2023-10-29 17:26:05 +00:00
name : {{ include "ingress-nginx.admissionWebhooks.createSecretJob.fullname" . }}
2020-03-02 14:49:26 +00:00
{{- if .Values.controller.admissionWebhooks.patch.podAnnotations }}
annotations : {{ toYaml .Values.controller.admissionWebhooks.patch.podAnnotations | nindent 8 }}
{{- end }}
2020-02-24 19:25:57 +00:00
labels :
2020-02-28 14:53:24 +00:00
{{- include "ingress-nginx.labels" . | nindent 8 }}
app.kubernetes.io/component : admission-webhook
2021-11-19 14:52:52 +00:00
{{- with .Values.controller.admissionWebhooks.patch.labels }}
{{- toYaml . | nindent 8 }}
{{- end }}
2020-02-24 19:25:57 +00:00
spec :
2020-03-02 14:49:26 +00:00
{{- if .Values.controller.admissionWebhooks.patch.priorityClassName }}
2020-02-24 19:25:57 +00:00
priorityClassName : {{ .Values.controller.admissionWebhooks.patch.priorityClassName }}
2020-05-04 17:46:27 +00:00
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets : {{ toYaml .Values.imagePullSecrets | nindent 8 }}
2020-03-02 14:49:26 +00:00
{{- end }}
2020-02-24 19:25:57 +00:00
containers :
- name : create
2024-09-30 08:26:04 +00:00
{{- with (merge .Values.controller.admissionWebhooks.patch.image .Values.global.image) }}
2023-12-05 16:22:12 +00:00
image : {{ if .repository }}{{ .repository }}{{ else }}{{ .registry }}/{{ .image }}{{ end }}:{{ .tag }}{{ if .digest }}@{{ .digest }}{{ end }}
2020-05-20 15:34:18 +00:00
{{- end }}
2020-02-24 19:25:57 +00:00
imagePullPolicy : {{ .Values.controller.admissionWebhooks.patch.image.pullPolicy }}
args :
- create
2020-07-29 09:08:51 +00:00
- --host={{ include "ingress-nginx.controller.fullname" . }}-admission,{{ include "ingress-nginx.controller.fullname" . }}-admission.$(POD_NAMESPACE).svc
- --namespace=$(POD_NAMESPACE)
2023-10-29 17:26:05 +00:00
- --secret-name={{ include "ingress-nginx.admissionWebhooks.fullname" . }}
2020-07-29 09:08:51 +00:00
env :
- name : POD_NAMESPACE
valueFrom :
fieldRef :
fieldPath : metadata.namespace
2022-06-21 14:16:26 +00:00
{{- if .Values.controller.admissionWebhooks.extraEnvs }}
{{- toYaml .Values.controller.admissionWebhooks.extraEnvs | nindent 12 }}
{{- end }}
2022-10-25 21:14:36 +00:00
{{- if .Values.controller.admissionWebhooks.createSecretJob.securityContext }}
securityContext : {{ toYaml .Values.controller.admissionWebhooks.createSecretJob.securityContext | nindent 12 }}
{{- end }}
2021-08-05 22:31:41 +00:00
{{- if .Values.controller.admissionWebhooks.createSecretJob.resources }}
resources : {{ toYaml .Values.controller.admissionWebhooks.createSecretJob.resources | nindent 12 }}
{{- end }}
2020-02-24 19:25:57 +00:00
restartPolicy : OnFailure
2024-06-03 09:17:23 +00:00
serviceAccountName : {{ include "ingress-nginx.admissionWebhooks.patch.serviceAccountName" . }}
2024-10-29 20:55:25 +00:00
automountServiceAccountToken : {{ .Values.controller.admissionWebhooks.patch.serviceAccount.automountServiceAccountToken }}
2020-03-02 14:49:26 +00:00
{{- if .Values.controller.admissionWebhooks.patch.nodeSelector }}
nodeSelector : {{ toYaml .Values.controller.admissionWebhooks.patch.nodeSelector | nindent 8 }}
2020-05-19 05:58:57 +00:00
{{- end }}
{{- if .Values.controller.admissionWebhooks.patch.tolerations }}
tolerations : {{ toYaml .Values.controller.admissionWebhooks.patch.tolerations | nindent 8 }}
2020-03-02 14:49:26 +00:00
{{- end }}
2023-11-07 17:52:36 +00:00
{{- if .Values.controller.admissionWebhooks.patch.securityContext }}
securityContext : {{ toYaml .Values.controller.admissionWebhooks.patch.securityContext | nindent 8 }}
{{- end }}
2020-02-24 19:25:57 +00:00
{{- end }}