default-backend-role.yaml 806 B

12345678910111213141516171819202122
  1. {{- if and .Values.rbac.create .Values.podSecurityPolicy.enabled .Values.defaultBackend.enabled -}}
  2. apiVersion: rbac.authorization.k8s.io/v1
  3. kind: Role
  4. metadata:
  5. labels:
  6. {{- include "ingress-nginx.labels" . | nindent 4 }}
  7. app.kubernetes.io/component: default-backend
  8. {{- with .Values.defaultBackend.labels }}
  9. {{- toYaml . | nindent 4 }}
  10. {{- end }}
  11. name: {{ include "ingress-nginx.fullname" . }}-backend
  12. namespace: {{ .Release.Namespace }}
  13. rules:
  14. - apiGroups: [{{ template "podSecurityPolicy.apiGroup" . }}]
  15. resources: ['podsecuritypolicies']
  16. verbs: ['use']
  17. {{- with .Values.defaultBackend.existingPsp }}
  18. resourceNames: [{{ . }}]
  19. {{- else }}
  20. resourceNames: [{{ include "ingress-nginx.fullname" . }}-backend]
  21. {{- end }}
  22. {{- end }}