2020-02-24 19:25:57 +00:00
|
|
|
{{- if and .Values.rbac.create .Values.podSecurityPolicy.enabled .Values.defaultBackend.enabled -}}
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: Role
|
|
|
|
metadata:
|
|
|
|
labels:
|
2020-02-27 04:27:28 +00:00
|
|
|
{{- include "nginx-ingress.labels" . | nindent 4 }}
|
|
|
|
app.kubernetes.io/component: {{ .Values.defaultBackend.name | quote }}
|
|
|
|
name: {{ include "nginx-ingress.fullname" . }}-backend
|
2020-02-24 19:25:57 +00:00
|
|
|
rules:
|
|
|
|
- apiGroups: ['{{ template "podSecurityPolicy.apiGroup" . }}']
|
|
|
|
resources: ['podsecuritypolicies']
|
|
|
|
verbs: ['use']
|
2020-02-27 04:27:28 +00:00
|
|
|
resourceNames: [{{ include "nginx-ingress.fullname" . }}-backend]
|
2020-02-24 19:25:57 +00:00
|
|
|
{{- end -}}
|