2024-06-03 09:17:23 +00:00
{{- if and .Values.controller.admissionWebhooks.enabled .Values.controller.admissionWebhooks.patch.enabled .Values.controller.admissionWebhooks.patch.rbac.create (not .Values.controller.admissionWebhooks.certManager.enabled) -}}
2020-02-24 19:25:57 +00:00
apiVersion : rbac.authorization.k8s.io/v1
kind : ClusterRole
metadata :
2023-10-29 17:26:05 +00:00
name : {{ include "ingress-nginx.admissionWebhooks.fullname" . }}
2020-02-24 19:25:57 +00:00
annotations :
"helm.sh/hook": pre-install,pre-upgrade,post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
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
rules :
- apiGroups :
- admissionregistration.k8s.io
resources :
- validatingwebhookconfigurations
verbs :
- get
- update
{{- if .Values.podSecurityPolicy.enabled }}
2023-11-07 17:52:36 +00:00
- apiGroups : [ {{ template "podSecurityPolicy.apiGroup" . }}]
resources : [ 'podsecuritypolicies' ]
verbs : [ 'use' ]
2021-02-24 00:31:56 +00:00
{{- with .Values.controller.admissionWebhooks.existingPsp }}
2023-11-07 17:52:36 +00:00
resourceNames : [ {{ . }}]
2021-02-24 00:31:56 +00:00
{{- else }}
2023-11-07 17:52:36 +00:00
resourceNames : [ {{ include "ingress-nginx.admissionWebhooks.fullname" . }}]
2021-02-24 00:31:56 +00:00
{{- end }}
2020-02-24 19:25:57 +00:00
{{- end }}
{{- end }}