diff --git a/charts/descheduler/templates/clusterrole.yaml b/charts/descheduler/templates/clusterrole.yaml index 3a1c3d60b6..371e8d2920 100644 --- a/charts/descheduler/templates/clusterrole.yaml +++ b/charts/descheduler/templates/clusterrole.yaml @@ -27,6 +27,17 @@ rules: - apiGroups: ["policy"] resources: ["poddisruptionbudgets"] verbs: ["get", "watch", "list"] +- apiGroups: ["policy"] + resources: ["poddisruptionbudgets"] + verbs: ["get", "list", "watch"] +{{- if .Values.deschedulerPolicy.metricsCollector.enabled }} +- apiGroups: ["metrics.k8s.io"] + resources: ["pods"] + verbs: ["get", "list", "watch"] +- apiGroups: ["metrics.k8s.io"] + resources: ["nodes"] + verbs: ["get", "list", "watch"] +{{- end }} {{- if .Values.leaderElection.enabled }} - apiGroups: ["coordination.k8s.io"] resources: ["leases"]