diff --git a/stable/nginx-ingress/templates/controller-role.yaml b/stable/nginx-ingress/templates/controller-role.yaml index ab639a772e54..3cb7620cae05 100644 --- a/stable/nginx-ingress/templates/controller-role.yaml +++ b/stable/nginx-ingress/templates/controller-role.yaml @@ -82,7 +82,7 @@ rules: - create - patch {{- if .Values.podSecurityPolicy.enabled }} - - apiGroups: ['extensions'] + - apiGroups: ['{{ template "podSecurityPolicy.apiVersion" . }}'] resources: ['podsecuritypolicies'] verbs: ['use'] resourceNames: [{{ template "nginx-ingress.fullname" . }}] diff --git a/stable/nginx-ingress/templates/default-backend-role.yaml b/stable/nginx-ingress/templates/default-backend-role.yaml index a5def02ec65e..47256b814fd9 100644 --- a/stable/nginx-ingress/templates/default-backend-role.yaml +++ b/stable/nginx-ingress/templates/default-backend-role.yaml @@ -9,7 +9,7 @@ metadata: release: {{ .Release.Name }} name: {{ template "nginx-ingress.fullname" . }}-backend rules: - - apiGroups: ['extensions'] + - apiGroups: ['{{ template "podSecurityPolicy.apiVersion" . }}'] resources: ['podsecuritypolicies'] verbs: ['use'] resourceNames: [{{ template "nginx-ingress.fullname" . }}-backend]