Descheduler
Scope: Cluster
Descheduler is a description of a single descheduler instance.
- apiVersion
- kind
- metadata
- metadata.name
- spec
Required value
Defines the behavior of a descheduler instance.
- spec.namespaceLabelSelector
Limiting the pods which are processed by namespace labels.
- spec.namespaceLabelSelector.matchExpressions
List of label expressions that a node should have to qualify for the filter condition.
Example:
matchExpressions: - key: tier operator: In values: - production - staging - key: tier operator: NotIn values: - production
- spec.namespaceLabelSelector.matchExpressions.key
A label name.
- spec.namespaceLabelSelector.matchExpressions.operator
A comparison operator.
Allowed values:
In
,NotIn
,Exists
,DoesNotExist
- spec.namespaceLabelSelector.matchExpressions.values
A label value.
- Element of the array
Pattern:
[a-z0-9]([-a-z0-9]*[a-z0-9])?
Length:
1..63
- spec.namespaceLabelSelector.matchLabels
- spec.nodeLabelSelector
Limiting the pods which are processed to fit evicted pods by labels in set representation. If set,
nodeSelector
must not be set.- spec.nodeLabelSelector.matchExpressions
List of label expressions that a node should have to qualify for the filter condition.
Example:
matchExpressions: - key: tier operator: In values: - production - staging - key: tier operator: NotIn values: - production
- spec.nodeLabelSelector.matchExpressions.key
A label name.
- spec.nodeLabelSelector.matchExpressions.operator
A comparison operator.
Allowed values:
In
,NotIn
,Exists
,DoesNotExist
- spec.nodeLabelSelector.matchExpressions.values
A label value.
- Element of the array
Pattern:
[a-z0-9]([-a-z0-9]*[a-z0-9])?
Length:
1..63
- spec.nodeLabelSelector.matchLabels
- spec.podLabelSelector
Limiting the pods which are processed by labels.
- spec.podLabelSelector.matchExpressions
List of label expressions that a node should have to qualify for the filter condition.
Example:
matchExpressions: - key: tier operator: In values: - production - staging - key: tier operator: NotIn values: - production
- spec.podLabelSelector.matchExpressions.key
A label name.
- spec.podLabelSelector.matchExpressions.operator
A comparison operator.
Allowed values:
In
,NotIn
,Exists
,DoesNotExist
- spec.podLabelSelector.matchExpressions.values
A label value.
- Element of the array
Pattern:
[a-z0-9]([-a-z0-9]*[a-z0-9])?
Length:
1..63
- spec.podLabelSelector.matchLabels
- spec.priorityClassThreshold
Limiting the pods which are processed by priority class. Only pods under the threshold can be evicted.
You can specify either the name of the priority class (priorityClassThreshold.name), or the actual value of the priority class (priorityThreshold.value).
By default, this threshold is set to the value of
system-cluster-critical
priority class.- spec.priorityClassThreshold.name
Name of the priority class.
- spec.priorityClassThreshold.value
Value of the priority class.
- spec.strategies
Required value
Settings of strategies for the Descheduler instances.
- spec.strategies.highNodeUtilization
This strategy finds nodes that are under utilized and evicts Pods from the nodes in the hope that these pods will be scheduled compactly into fewer nodes. When combined with node auto-scaling, it helps reduce the number of underutilized nodes. The strategy works with the
MostAllocated
scheduler.In GKE, you cannot configure the default scheduler, but you can use the
optimize-utilization
strategy or deploy a second custom scheduler.Node resource usage takes into account extended resources and is based on pod requests and limits, not actual consumption.
- spec.strategies.highNodeUtilization.enabled
Makes the strategy active.
Default:
false
- spec.strategies.highNodeUtilization.thresholds
Sets threshold values to identify to identify under utilized nodes.
If the resource usage of the node is below all threshold values, then the node is considered under utilized.
- spec.strategies.highNodeUtilization.thresholds.cpu
CPU fraction in percents
Default:
20
- spec.strategies.highNodeUtilization.thresholds.memory
Memory fraction in percents
Default:
20
- spec.strategies.highNodeUtilization.thresholds.pods
Pods count in percents
Default:
20
- spec.strategies.lowNodeUtilization
This strategy identifies under utilized nodes and evicts pods from other over utilized nodes. The strategy assumes that the evicted pods will be recreated on the under utilized nodes (following normal scheduler behavior).
Under utilized node — A node whose resource usage is below all the threshold values specified in the thresholds section.
Over utilized node — A node whose resource usage exceeds at least one of the threshold values specified in the targetThresholds section.
Node resource usage takes into account extended resources and is based on pod requests and limits, not actual consumption.
- spec.strategies.lowNodeUtilization.enabled
Makes the strategy active.
Default:
false
- spec.strategies.lowNodeUtilization.targetThresholds
Sets threshold values to identify to identify over utilized nodes.
If the resource usage of the node exceeds at least one of the threshold values, then the node is considered over utilized.
- spec.strategies.lowNodeUtilization.targetThresholds.cpu
CPU fraction in percents
Default:
70
- spec.strategies.lowNodeUtilization.targetThresholds.memory
Memory fraction in percents
Default:
70
- spec.strategies.lowNodeUtilization.targetThresholds.pods
Pods count in percents
Default:
70
- spec.strategies.lowNodeUtilization.thresholds
Sets threshold values to identify to identify under utilized nodes.
If the resource usage of the node is below all threshold values, then the node is considered under utilized.
- spec.strategies.lowNodeUtilization.thresholds.cpu
CPU fraction in percents
Default:
20
- spec.strategies.lowNodeUtilization.thresholds.memory
Memory fraction in percents
Default:
20
- spec.strategies.lowNodeUtilization.thresholds.pods
Pods count in percents
Default:
20
- spec.strategies.removeDuplicates
The strategy ensures that no more than one pod of a ReplicaSet, ReplicationController, StatefulSet, or pods of a single Job is running on the same node. If there are two or more such pods, the module evicts the excess pods so that they are better distributed across the cluster.
- spec.strategies.removeDuplicates.enabled
Makes the strategy active.
Default:
false
- spec.strategies.removePodsViolatingInterPodAntiAffinity
The strategy ensures that pods violating inter-pod affinity and anti-affinity rules are evicted from nodes.
- spec.strategies.removePodsViolatingInterPodAntiAffinity.enabled
Makes the strategy active.
Default:
false
- spec.strategies.removePodsViolatingNodeAffinity
The strategy makes sure all pods violating node affinity are eventually removed from nodes.
Essentially, depending on the settings of the parameter nodeAffinityType, the strategy temporarily implement the rule
requiredDuringSchedulingIgnoredDuringExecution
of the pod’s node affinity as the rulerequiredDuringSchedulingRequiredDuringExecution
, and the rulepreferredDuringSchedulingIgnoredDuringExecution
as the rulepreferredDuringSchedulingPreferredDuringExecution
.- spec.strategies.removePodsViolatingNodeAffinity.enabled
Makes the strategy active.
Default:
false
- spec.strategies.removePodsViolatingNodeAffinity.nodeAffinityType
Defines the list of node affinity rules used.
Default:
["requiredDuringSchedulingIgnoredDuringExecution"]
- Element of the array
Allowed values:
requiredDuringSchedulingIgnoredDuringExecution
,preferredDuringSchedulingIgnoredDuringExecution
Deprecated resource. Support for the resource might be removed in a later release.
Descheduler is a description of a single descheduler instance.
- apiVersion
- kind
- metadata
- metadata.name
- spec
Required value
Defines the behavior of a descheduler instance.
- spec.deploymentTemplate
Defines Template of a descheduler Deployment.
- spec.deploymentTemplate.nodeSelector
- spec.deploymentTemplate.tolerations
- spec.deploymentTemplate.tolerations.effect
- spec.deploymentTemplate.tolerations.key
- spec.deploymentTemplate.tolerations.operator
- spec.deploymentTemplate.tolerations.tolerationSeconds
- spec.deploymentTemplate.tolerations.value
- spec.deschedulerPolicy.globalParameters
Parameters that apply to all policies.
- spec.deschedulerPolicy.globalParameters.evictFailedBarePods
Allows Pods without
ownerReferences
and infailed
phase to be evicted. - spec.deschedulerPolicy.globalParameters.evictLocalStoragePods
Allows Pods using local storage to be evicted.
- spec.deschedulerPolicy.globalParameters.evictSystemCriticalPods
Allows eviction of Pods of any priority (including Kubernetes system Pods).
- spec.deschedulerPolicy.globalParameters.ignorePvcPods
Prevents Pods with PVCs from being evicted.
- spec.deschedulerPolicy.globalParameters.maxNoOfPodsToEvictPerNamespace
Restricts maximum of Pods to be evicted per namespace.
- spec.deschedulerPolicy.globalParameters.maxNoOfPodsToEvictPerNode
Restricts maximum of Pods to be evicted per node.
- spec.deschedulerPolicy.globalParameters.nodeSelector
- spec.deschedulerPolicy.strategies
List of strategies with corresponding parameters for a given Descheduler instances.
- spec.deschedulerPolicy.strategies.highNodeUtilization
This strategy finds nodes that are under utilized and evicts Pods from the nodes in the hope that these Pods will be scheduled compactly into fewer nodes.
- spec.deschedulerPolicy.strategies.highNodeUtilization.enabled
Required value
- spec.deschedulerPolicy.strategies.highNodeUtilization.namespaceFilter
Restricts Namespaces to which this strategy applies.
- spec.deschedulerPolicy.strategies.highNodeUtilization.nodeFilter
Filters Nodes to which the strategy applies.
- spec.deschedulerPolicy.strategies.highNodeUtilization.nodeFit
If set to
true
, the descheduler will consider whether or not the Pods that meet eviction criteria will fit on other nodes before evicting them. - spec.deschedulerPolicy.strategies.highNodeUtilization.priorityFilter
Only Pods with priority lower than this will be descheduled.
- spec.deschedulerPolicy.strategies.lowNodeUtilization
This strategy finds nodes that are under utilized and evicts Pods, if possible, from other nodes in the hope that recreation of evicted Pods will be scheduled on these underutilized nodes.
- spec.deschedulerPolicy.strategies.lowNodeUtilization.enabled
Required value
- spec.deschedulerPolicy.strategies.lowNodeUtilization.namespaceFilter
Restricts Namespaces to which this strategy applies.
- spec.deschedulerPolicy.strategies.lowNodeUtilization.nodeFilter
Filters Nodes to which the strategy applies.
- spec.deschedulerPolicy.strategies.lowNodeUtilization.nodeFit
If set to
true
, the descheduler will consider whether or not the Pods that meet eviction criteria will fit on other nodes before evicting them. - spec.deschedulerPolicy.strategies.lowNodeUtilization.priorityFilter
Only Pods with priority lower than this will be descheduled.
- spec.deschedulerPolicy.strategies.removeDuplicates
This strategy makes sure that there is only one Pod associated with a ReplicaSet (RS), ReplicationController (RC), StatefulSet, or Job running on the same node.
- spec.deschedulerPolicy.strategies.removeDuplicates.enabled
Required value
- spec.deschedulerPolicy.strategies.removeDuplicates.namespaceFilter
Restricts Namespaces to which this strategy applies.
- spec.deschedulerPolicy.strategies.removeDuplicates.nodeFilter
Filters Nodes to which the strategy applies.
- spec.deschedulerPolicy.strategies.removeDuplicates.nodeFit
If set to
true
, the descheduler will consider whether or not the Pods that meet eviction criteria will fit on other nodes before evicting them. - spec.deschedulerPolicy.strategies.removeDuplicates.priorityFilter
Only Pods with priority lower than this will be descheduled.
- spec.deschedulerPolicy.strategies.removeFailedPods
This strategy evicts Pods that are in
failed
status phase.- spec.deschedulerPolicy.strategies.removeFailedPods.enabled
Required value
- spec.deschedulerPolicy.strategies.removeFailedPods.namespaceFilter
Restricts Namespaces to which this strategy applies.
- spec.deschedulerPolicy.strategies.removeFailedPods.nodeFilter
Filters Nodes to which the strategy applies.
- spec.deschedulerPolicy.strategies.removeFailedPods.nodeFit
If set to
true
, the descheduler will consider whether or not the Pods that meet eviction criteria will fit on other nodes before evicting them. - spec.deschedulerPolicy.strategies.removeFailedPods.priorityFilter
Only Pods with priority lower than this will be descheduled.
- spec.deschedulerPolicy.strategies.removePodsHavingTooManyRestarts
This strategy makes sure that Pods having too many restarts are removed from nodes.
- spec.deschedulerPolicy.strategies.removePodsHavingTooManyRestarts.enabled
Required value
- spec.deschedulerPolicy.strategies.removePodsHavingTooManyRestarts.namespaceFilter
Restricts Namespaces to which this strategy applies.
- spec.deschedulerPolicy.strategies.removePodsHavingTooManyRestarts.nodeFilter
Filters Nodes to which the strategy applies.
- spec.deschedulerPolicy.strategies.removePodsHavingTooManyRestarts.nodeFit
If set to
true
, the descheduler will consider whether or not the Pods that meet eviction criteria will fit on other nodes before evicting them. - spec.deschedulerPolicy.strategies.removePodsHavingTooManyRestarts.priorityFilter
Only Pods with priority lower than this will be descheduled.
- spec.deschedulerPolicy.strategies.removePodsViolatingInterPodAntiAffinity
This strategy makes sure that Pods violating interpod anti-affinity are removed from nodes.
- spec.deschedulerPolicy.strategies.removePodsViolatingInterPodAntiAffinity.enabled
Required value
- spec.deschedulerPolicy.strategies.removePodsViolatingInterPodAntiAffinity.namespaceFilter
Restricts Namespaces to which this strategy applies.
- spec.deschedulerPolicy.strategies.removePodsViolatingInterPodAntiAffinity.nodeFilter
Filters Nodes to which the strategy applies.
- spec.deschedulerPolicy.strategies.removePodsViolatingInterPodAntiAffinity.nodeFit
If set to
true
, the descheduler will consider whether or not the Pods that meet eviction criteria will fit on other nodes before evicting them. - spec.deschedulerPolicy.strategies.removePodsViolatingInterPodAntiAffinity.priorityFilter
Only Pods with priority lower than this will be descheduled.
- spec.deschedulerPolicy.strategies.removePodsViolatingNodeAffinity
This strategy makes sure all Pods violating node affinity are eventually removed from nodes.
- spec.deschedulerPolicy.strategies.removePodsViolatingNodeAffinity.enabled
Required value
- spec.deschedulerPolicy.strategies.removePodsViolatingNodeAffinity.namespaceFilter
Restricts Namespaces to which this strategy applies.
- spec.deschedulerPolicy.strategies.removePodsViolatingNodeAffinity.nodeFilter
Filters Nodes to which the strategy applies.
- spec.deschedulerPolicy.strategies.removePodsViolatingNodeAffinity.nodeFit
If set to
true
, the descheduler will consider whether or not the Pods that meet eviction criteria will fit on other nodes before evicting them. - spec.deschedulerPolicy.strategies.removePodsViolatingNodeAffinity.priorityFilter
Only Pods with priority lower than this will be descheduled.
- spec.deschedulerPolicy.strategies.removePodsViolatingNodeTaints
This strategy makes sure that Pods violating
NoSchedule
taints on nodes are removed.- spec.deschedulerPolicy.strategies.removePodsViolatingNodeTaints.enabled
Required value
- spec.deschedulerPolicy.strategies.removePodsViolatingNodeTaints.namespaceFilter
Restricts Namespaces to which this strategy applies.
- spec.deschedulerPolicy.strategies.removePodsViolatingNodeTaints.nodeFilter
Filters Nodes to which the strategy applies.
- spec.deschedulerPolicy.strategies.removePodsViolatingNodeTaints.nodeFit
If set to
true
, the descheduler will consider whether or not the Pods that meet eviction criteria will fit on other nodes before evicting them. - spec.deschedulerPolicy.strategies.removePodsViolatingNodeTaints.priorityFilter
Only Pods with priority lower than this will be descheduled.
- spec.deschedulerPolicy.strategies.removePodsViolatingTopologySpreadConstraint
This strategy makes sure that Pods violating topology spread constraints are evicted from nodes.
- spec.deschedulerPolicy.strategies.removePodsViolatingTopologySpreadConstraint.enabled
Required value
- spec.deschedulerPolicy.strategies.removePodsViolatingTopologySpreadConstraint.namespaceFilter
Restricts Namespaces to which this strategy applies.
- spec.deschedulerPolicy.strategies.removePodsViolatingTopologySpreadConstraint.nodeFilter
Filters Nodes to which the strategy applies.
- spec.deschedulerPolicy.strategies.removePodsViolatingTopologySpreadConstraint.nodeFit
If set to
true
, the descheduler will consider whether or not the Pods that meet eviction criteria will fit on other nodes before evicting them. - spec.deschedulerPolicy.strategies.removePodsViolatingTopologySpreadConstraint.priorityFilter
Only Pods with priority lower than this will be descheduled.