When you enable Adaptive Pod placement on a cluster, the following steps are done:
1. Kompass classifies Pods:
Kompass begins to classify each Pod as either Evictable or Unevictable, based on the same logic used by the cluster’s autoscaler. Pods are classified when they are created and then reviewed periodically.
Kompass labels each Pod as either Kompass-evictable or Kompass-unevictable.
If a Pod’s classification changes throughout its lifecycle (for example, when there is a PDB configuration change), the label is updated.
2. Kompass mutates Pod scheduling using affinity rules:
Kompass adds the following rules to the Pod specification:
Soft affinity toward Pods with the same classification.
Group evictable Pods with other evictable Pods, and group unevictable Pods with unevictable Pods.Soft anti-affinity away from Pods with the other classification.
Keep evictable Pods and unevictable Pods away from each other.
The scheduler then schedules Pods onto nodes based on classification and soft affinity rules. The affinity rule flexibility enables cost savings even when the best solution isn’t an option. For example, the scheduler could place an unevictable Pod on an existing node instead of creating a new one.
Kompass logs all actions related to Pod placement, including labeling, affinity rules, and eviction.
Pod eviction
Pods are evicted to improve Pod placement across the cluster when this increases the likelihood of node consolidation.
To protect application disruption, Zesty-triggered eviction is limited per workload.
Kompass enforces these limits as follows:
If a Pod Disruption Budget (PDB) is configured, eviction is limited according to the PDB.
If no PDB is configured, eviction is limited by a user-defined threshold (
--eviction-max-pods-multiplier, default is 20% of the Pods in a workload).
Eviction is performed in cycles (--eviction-interval, default is 4 hours), and limits are applied during each cycle.
These types of Pods are not evicted:
Pods from Jobs/CronJobs workloads
Pods classified as unevictable
Limitations:
Supports only Karpenter and Cluster Autoscaler.
Runs only on clusters on which Pod rightsizing is enabled.
See also: