ingress-nginx-helm/charts/ingress-nginx/templates/admission-webhooks/job-patch/job-patchWebhook.yaml

58 lines
2.6 KiB
YAML
Raw Normal View History

2020-03-02 08:49:26 -06:00
{{- if and .Values.controller.admissionWebhooks.enabled .Values.controller.admissionWebhooks.patch.enabled -}}
2020-02-24 16:25:57 -03:00
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "ingress-nginx.fullname" . }}-admission-patch
2020-02-24 16:25:57 -03:00
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
labels:
{{- include "ingress-nginx.labels" . | nindent 4 }}
app.kubernetes.io/component: admission-webhook
2020-02-24 16:25:57 -03:00
spec:
2020-03-02 08:49:26 -06:00
{{- if .Capabilities.APIVersions.Has "batch/v1alpha1" }}
2020-02-24 16:25:57 -03:00
# Alpha feature since k8s 1.12
ttlSecondsAfterFinished: 0
2020-03-02 08:49:26 -06:00
{{- end }}
2020-02-24 16:25:57 -03:00
template:
metadata:
name: {{ include "ingress-nginx.fullname" . }}-admission-patch
2020-03-02 08:49:26 -06:00
{{- if .Values.controller.admissionWebhooks.patch.podAnnotations }}
annotations: {{ toYaml .Values.controller.admissionWebhooks.patch.podAnnotations | nindent 8 }}
{{- end }}
2020-02-24 16:25:57 -03:00
labels:
{{- include "ingress-nginx.labels" . | nindent 8 }}
app.kubernetes.io/component: admission-webhook
2020-02-24 16:25:57 -03:00
spec:
2020-03-02 08:49:26 -06:00
{{- if .Values.controller.admissionWebhooks.patch.priorityClassName }}
2020-02-24 16:25:57 -03:00
priorityClassName: {{ .Values.controller.admissionWebhooks.patch.priorityClassName }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets: {{ toYaml .Values.imagePullSecrets | nindent 8 }}
2020-03-02 08:49:26 -06:00
{{- end }}
2020-02-24 16:25:57 -03:00
containers:
- name: patch
{{- with .Values.controller.admissionWebhooks.patch.image }}
2020-07-09 19:25:33 -04:00
image: "{{.repository}}:{{ .tag }}{{- if (.digest) -}} @{{.digest}} {{- end -}}"
{{- end }}
imagePullPolicy: {{ .Values.controller.admissionWebhooks.patch.image.pullPolicy }}
2020-02-24 16:25:57 -03:00
args:
- patch
- --webhook-name={{ include "ingress-nginx.fullname" . }}-admission
2020-02-24 16:25:57 -03:00
- --namespace={{ .Release.Namespace }}
- --patch-mutating=false
- --secret-name={{ include "ingress-nginx.fullname" . }}-admission
2020-02-24 16:25:57 -03:00
- --patch-failure-policy={{ .Values.controller.admissionWebhooks.failurePolicy }}
restartPolicy: OnFailure
serviceAccountName: {{ include "ingress-nginx.fullname" . }}-admission
2020-03-02 08:49:26 -06:00
{{- if .Values.controller.admissionWebhooks.patch.nodeSelector }}
nodeSelector: {{ toYaml .Values.controller.admissionWebhooks.patch.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.controller.admissionWebhooks.patch.tolerations }}
tolerations: {{ toYaml .Values.controller.admissionWebhooks.patch.tolerations | nindent 8 }}
2020-03-02 08:49:26 -06:00
{{- end }}
2020-02-24 16:25:57 -03:00
securityContext:
runAsNonRoot: true
runAsUser: {{ .Values.controller.admissionWebhooks.patch.runAsUser }}
{{- end }}