# grafana_charts_rolebinding-tokengen.yaml
{{ if .Values.tokengen.enable }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: {{ template "enterprise-logs.tokengenFullname" . }}
  labels:
    {{- include "enterprise-logs.tokengenLabels" . | nindent 4 }}
    {{- with .Values.tokengen.labels }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
  annotations:
    {{- with .Values.tokengen.annotations }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
    "helm.sh/hook": post-install
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: {{ template "enterprise-logs.tokengenFullname" . }}
subjects:
  - kind: ServiceAccount
    name: {{ include "loki.serviceAccountName" . }}
{{- end }}