{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: {{ include "fluent-bit.fullname" . }}
  labels:
    {{- include "fluent-bit.labels" . | nindent 4 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ include "fluent-bit.fullname" . }}
subjects:
  - kind: ServiceAccount
    name: {{ include "fluent-bit.serviceAccountName" . }}
    namespace: {{ .Release.Namespace }}
{{- end -}}
