{{- if (.Values.global.use_rbac) -}}
{{- if (.Capabilities.APIVersions.Has (include "rbacAPIVersion" .)) -}}
kind: ClusterRoleBinding 
apiVersion: {{ template "rbacAPIVersion" . }}
metadata:
  name: drycc:drycc-monitor-telegraf
  labels:
    app: drycc-monitor-telegraf
    heritage: drycc
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: drycc:drycc-monitor-telegraf
subjects:
- kind: ServiceAccount
  name: drycc-monitor-telegraf
  namespace: {{ .Release.Namespace }}
{{- end -}}
{{- end -}}

