2020-02-24 16:25:57 -03:00
|
|
|
{{- if and .Values.controller.admissionWebhooks.enabled .Values.controller.admissionWebhooks.patch.enabled }}
|
|
|
|
|
apiVersion: batch/v1
|
|
|
|
|
kind: Job
|
|
|
|
|
metadata:
|
2020-02-26 23:27:28 -05:00
|
|
|
name: {{ include "nginx-ingress.fullname" . }}-admission-create
|
2020-02-24 16:25:57 -03:00
|
|
|
annotations:
|
|
|
|
|
"helm.sh/hook": pre-install,pre-upgrade
|
|
|
|
|
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
|
|
|
|
|
labels:
|
2020-02-26 23:27:28 -05:00
|
|
|
{{- include "nginx-ingress.labels" . | nindent 4 }}
|
|
|
|
|
app.kubernetes.io/component: {{ .Values.controller.name | quote }}
|
2020-02-24 16:25:57 -03:00
|
|
|
spec:
|
|
|
|
|
{{- if .Capabilities.APIVersions.Has "batch/v1alpha1" }}
|
|
|
|
|
# Alpha feature since k8s 1.12
|
|
|
|
|
ttlSecondsAfterFinished: 0
|
|
|
|
|
{{- end }}
|
|
|
|
|
template:
|
|
|
|
|
metadata:
|
2020-02-26 23:27:28 -05:00
|
|
|
name: {{ include "nginx-ingress.fullname" . }}-admission-create
|
2020-02-24 16:25:57 -03:00
|
|
|
{{- with .Values.controller.admissionWebhooks.patch.podAnnotations }}
|
|
|
|
|
annotations:
|
|
|
|
|
{{ toYaml . | indent 8 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
labels:
|
2020-02-26 23:27:28 -05:00
|
|
|
{{- include "nginx-ingress.labels" . | nindent 8 }}
|
|
|
|
|
app.kubernetes.io/component: {{ .Values.controller.name | quote }}
|
2020-02-24 16:25:57 -03:00
|
|
|
spec:
|
|
|
|
|
{{- if .Values.controller.admissionWebhooks.patch.priorityClassName }}
|
|
|
|
|
priorityClassName: {{ .Values.controller.admissionWebhooks.patch.priorityClassName }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
containers:
|
|
|
|
|
- name: create
|
|
|
|
|
image: {{ .Values.controller.admissionWebhooks.patch.image.repository }}:{{ .Values.controller.admissionWebhooks.patch.image.tag }}
|
|
|
|
|
imagePullPolicy: {{ .Values.controller.admissionWebhooks.patch.image.pullPolicy }}
|
|
|
|
|
args:
|
|
|
|
|
- create
|
|
|
|
|
- --host={{ template "nginx-ingress.controller.fullname" . }}-admission,{{ template "nginx-ingress.controller.fullname" . }}-admission.{{ .Release.Namespace }}.svc
|
|
|
|
|
- --namespace={{ .Release.Namespace }}
|
|
|
|
|
- --secret-name={{ template "nginx-ingress.fullname". }}-admission
|
|
|
|
|
restartPolicy: OnFailure
|
2020-02-26 23:27:28 -05:00
|
|
|
serviceAccountName: {{ include "nginx-ingress.fullname" . }}-admission
|
2020-02-24 16:25:57 -03:00
|
|
|
{{- with .Values.controller.admissionWebhooks.patch.nodeSelector }}
|
|
|
|
|
nodeSelector:
|
|
|
|
|
{{ toYaml . | indent 8 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
securityContext:
|
|
|
|
|
runAsNonRoot: true
|
|
|
|
|
runAsUser: 2000
|
|
|
|
|
{{- end }}
|