# helm_charts_custom-metrics-apiserver-auth-reader-role-binding.yaml
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "k8s-prometheus-adapter.name" . }}-auth-reader
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: extension-apiserver-authentication-reader
subjects:
- kind: ServiceAccount
  name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
  namespace: {{ .Release.Namespace | quote }}
{{- end -}}