
{{- range .Values.roleBindings }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: {{ .name }}
  labels:
    chart: {{ template "magic-namespace.chart" $ }}
    release: {{ $.Release.Name }}
    heritage: {{ $.Release.Service }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: {{ .role.kind }}
  name: {{ .role.name }}
subjects:
- kind: {{ .subject.kind }}
  name: {{ .subject.name }}
{{- end }}
