# helm_charts_collector-rbac.yaml
{{- if and .Values.rbac.create .Values.collector.enabled }}
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  labels:
    app.kubernetes.io/name : {{ template "wavefront.fullname" . }}
    helm.sh/chart: {{ template "wavefront.chart" . }}
    app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
    app.kubernetes.io.instance: {{ .Release.Name | quote }}
    app.kubernetes.io/component: collector
  name: {{ template "wavefront.collector.fullname" . }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ template "wavefront.collector.fullname" . }}
subjects:
- kind: ServiceAccount
  name: {{ template "wavefront.collector.serviceAccountName" . }}
  namespace: {{ .Release.Namespace }}
{{- end }}