{{- if .Values.rbac.create -}} apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} kind: ClusterRole metadata: name: {{ include "common.names.fullname" . }} labels: {{- include "common.labels.standard" . | nindent 4 }} {{- if .Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} rules: - apiGroups: - "" resources: - pods - nodes - namespaces verbs: - get - list - watch - apiGroups: - "" resources: - nodes/metrics verbs: - get - create --- apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} kind: ClusterRole metadata: labels: {{- include "common.labels.standard" . | nindent 4 }} rbac.authorization.k8s.io/aggregate-to-admin: "true" rbac.authorization.k8s.io/aggregate-to-edit: "true" rbac.authorization.k8s.io/aggregate-to-view: "true" name: {{ include "common.names.fullname" . }}-view rules: - apiGroups: - metrics.k8s.io resources: - pods - nodes verbs: - get - list - watch {{- end -}}