github.com/kubevela/workflow@v0.6.0/charts/vela-workflow/templates/admission-webhooks/job-patch/job-patchWebhook.yaml (about) 1 {{- if and .Values.admissionWebhooks.enabled .Values.admissionWebhooks.patch.enabled (not .Values.admissionWebhooks.certManager.enabled) }} 2 apiVersion: batch/v1 3 kind: Job 4 metadata: 5 name: {{ template "kubevela.fullname" . }}-admission-patch 6 namespace: {{ .Release.Namespace }} 7 annotations: 8 "helm.sh/hook": post-install,post-upgrade 9 "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded 10 labels: 11 app: {{ template "kubevela.name" . }}-admission-patch 12 {{- include "kubevela.labels" . | nindent 4 }} 13 spec: 14 {{- if .Capabilities.APIVersions.Has "batch/v1alpha1" }} 15 # Alpha feature since k8s 1.12 16 ttlSecondsAfterFinished: 0 17 {{- end }} 18 template: 19 metadata: 20 name: {{ template "kubevela.fullname" . }}-admission-patch 21 labels: 22 app: {{ template "kubevela.name" . }}-admission-patch 23 {{- include "kubevela.labels" . | nindent 8 }} 24 spec: 25 {{- with .Values.imagePullSecrets }} 26 imagePullSecrets: 27 {{- toYaml . | nindent 8 }} 28 {{- end }} 29 containers: 30 - name: patch 31 image: {{ .Values.imageRegistry }}{{ .Values.admissionWebhooks.patch.image.repository }}:{{ .Values.admissionWebhooks.patch.image.tag }} 32 imagePullPolicy: {{ .Values.admissionWebhooks.patch.image.pullPolicy }} 33 args: 34 - patch 35 - --webhook-name={{ template "kubevela.fullname" . }}-admission 36 - --namespace={{ .Release.Namespace }} 37 - --secret-name={{ template "kubevela.fullname" . }}-admission 38 - --patch-failure-policy={{ .Values.admissionWebhooks.failurePolicy }} 39 restartPolicy: OnFailure 40 serviceAccountName: {{ template "kubevela.fullname" . }}-admission 41 {{- with .Values.admissionWebhooks.patch.affinity }} 42 affinity: 43 {{ toYaml . | indent 8 }} 44 {{- end }} 45 {{- with .Values.admissionWebhooks.patch.tolerations }} 46 tolerations: 47 {{ toYaml . | indent 8 }} 48 {{- end }} 49 securityContext: 50 runAsGroup: 2000 51 runAsNonRoot: true 52 runAsUser: 2000 53 {{- end }}