# helm_charts_metrics-server-crb.yaml
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: system:{{ template "metrics-server.fullname" . }}
  labels:
    app: {{ template "metrics-server.name" . }}
    chart: {{ template "metrics-server.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:{{ template "metrics-server.fullname" . }}
subjects:
  - kind: ServiceAccount
    name: {{ template "metrics-server.serviceAccountName" . }}
    namespace: {{ .Release.Namespace }}
{{- end -}}