role.yaml 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. {{- /*
  2. Copyright VMware, Inc.
  3. SPDX-License-Identifier: APACHE-2.0
  4. */}}
  5. {{- if .Values.rbac.create }}
  6. kind: Role
  7. apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
  8. metadata:
  9. name: {{ include "common.names.fullname" . }}
  10. namespace: {{ .Release.Namespace | quote }}
  11. labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
  12. {{- if .Values.commonAnnotations }}
  13. annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  14. {{- end }}
  15. # yamllint disable rule:indentation
  16. rules:
  17. {{- if and (include "common.capabilities.psp.supported" .) .Values.psp.create }}
  18. - apiGroups:
  19. - 'policy'
  20. resources:
  21. - 'podsecuritypolicies'
  22. verbs:
  23. - 'use'
  24. resourceNames:
  25. - {{ include "common.names.fullname" . }}
  26. {{- end }}
  27. {{- if .Values.rbac.rules }}
  28. {{- include "common.tplvalues.render" ( dict "value" .Values.rbac.rules "context" $ ) | nindent 2 }}
  29. {{- end }}
  30. # yamllint enable rule:indentation
  31. {{- end }}