{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: {{ template "hazelcast-jet.fullname" . }}
  labels:
    app.kubernetes.io/name: {{ template "hazelcast-jet.name" . }}
    helm.sh/chart: {{ template "hazelcast-jet.chart" . }}
    app.kubernetes.io/instance: "{{ .Release.Name }}"
    app.kubernetes.io/managed-by: "{{ .Release.Service }}"
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ template "hazelcast-jet.fullname" . }}
subjects:
- kind: ServiceAccount
  name: {{ template "hazelcast-jet.serviceAccountName" . }}
  namespace: {{ .Release.Namespace }}
{{ end }}
