diff --git a/charts/descheduler/templates/clusterrole.yaml b/charts/descheduler/templates/clusterrole.yaml index 8ea75c92ef..3a1c3d60b6 100644 --- a/charts/descheduler/templates/clusterrole.yaml +++ b/charts/descheduler/templates/clusterrole.yaml @@ -36,4 +36,9 @@ rules: resourceNames: ["{{ .Values.leaderElection.resourceName | default "descheduler" }}"] verbs: ["get", "patch", "delete"] {{- end }} +{{- if and .Values.deschedulerPolicy .Values.deschedulerPolicy.metricsCollector .Values.deschedulerPolicy.metricsCollector.enabled }} +- apiGroups: ["metrics.k8s.io"] + resources: ["pods", "nodes"] + verbs: ["get", "list"] +{{- end }} {{- end -}} diff --git a/charts/descheduler/values.yaml b/charts/descheduler/values.yaml index b064127bb6..17466b067e 100644 --- a/charts/descheduler/values.yaml +++ b/charts/descheduler/values.yaml @@ -96,6 +96,8 @@ deschedulerPolicy: # nodeSelector: "key1=value1,key2=value2" # maxNoOfPodsToEvictPerNode: 10 # maxNoOfPodsToEvictPerNamespace: 10 + # metricsCollector: + # enabled: true # ignorePvcPods: true # evictLocalStoragePods: true # evictDaemonSetPods: true