ingress-nginx-helm/charts/ingress-nginx/templates/default-backend-role.yaml
Long 2a190d2657
added namespace field in the namespace scoped resource templates of helm chart (#7256)
* added namespace field in the namespace scoped resource templates of helm chart

* moved namespace field from roleRef to metadata
2021-06-21 04:56:51 -07:00

19 lines
713 B
YAML

{{- if and .Values.rbac.create .Values.podSecurityPolicy.enabled .Values.defaultBackend.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
{{- include "ingress-nginx.labels" . | nindent 4 }}
app.kubernetes.io/component: default-backend
name: {{ include "ingress-nginx.fullname" . }}-backend
namespace: {{ .Release.Namespace }}
rules:
- apiGroups: [{{ template "podSecurityPolicy.apiGroup" . }}]
resources: ['podsecuritypolicies']
verbs: ['use']
{{- with .Values.defaultBackend.existingPsp }}
resourceNames: [{{ . }}]
{{- else }}
resourceNames: [{{ include "ingress-nginx.fullname" . }}-backend]
{{- end }}
{{- end }}