apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: {{ .Chart.Name }}-{{ .Release.Namespace }}-role
rules:
- apiGroups:
  - security.openshift.io
  resourceNames:
  - anyuid
  resources:
  - securitycontextconstraints
  verbs:
  - use
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: {{ .Chart.Name }}-{{ .Release.Namespace }}-binding
subjects:
- kind: ServiceAccount
  name: {{ .Values.global.serviceAccountName }}
  namespace: {{ .Release.Namespace }}
roleRef:
  kind: Role
  name: {{ .Chart.Name }}-{{ .Release.Namespace }}-role
  apiGroup: rbac.authorization.k8s.io
