apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: {{ include "dragonfly-operator.fullname" . }}-manager-clusterrolebinding
  labels:
    {{- include "dragonfly-operator.labels" . | nindent 4 }}
    app.kubernetes.io/component: rbac
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ include "dragonfly-operator.fullname" . }}-manager-role
subjects:
  - kind: ServiceAccount
    name: {{ include "dragonfly-operator.serviceAccountName" . }}
    namespace: {{ .Release.Namespace }}
---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: {{ include "dragonfly-operator.fullname" . }}-proxy-clusterrolebinding
  labels:
    {{- include "dragonfly-operator.labels" . | nindent 4 }}
    app.kubernetes.io/component: kube-rbac-proxy
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ include "dragonfly-operator.fullname" . }}-proxy-role
subjects:
  - kind: ServiceAccount
    name: {{ include "dragonfly-operator.serviceAccountName" . }}
    namespace: {{ .Release.Namespace }}