{{- if (.Values.global.rbac) -}}
kind: ClusterRoleBinding 
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: {{ printf "%s:drycc-monitor-telegraf" .Release.Namespace | quote }}
  labels:
    app: drycc-monitor-telegraf
    heritage: drycc
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ printf "%s:drycc-monitor-telegraf" .Release.Namespace | quote }}
subjects:
- kind: ServiceAccount
  name: drycc-monitor-telegraf
  namespace: {{ .Release.Namespace }}
{{- end -}}

