Pod Scale-in Priorities
Scale-in Priorities
Pod scale-in is performed based on the following priorities:
- Pods that are not scheduled
- Pod Pending < Pod Unknown < Pod Running
- Not ready < Ready
- Pod with a specific label (cce.io/priordeletion)
- Doubled up < Not doubled up (nodes with more pods are first downsized)
- Pods that take a long time to be ready for scale-in
- Pods that are frequently restarted
- Pods with an earlier createtimestamp
Preferential Scale-in of Old Pods
- Where such scale-in does not work:
According to the preceding priorities, assume that the number of nodes is 2 (the same specifications) and the number of pods in a Deployment is 5 (or any odd number), three pods distributed on node A and two on node B. If the number of pods is reduced to 3, Rule 5 is performed first, and the system determines that the node to be scaled in is node A. Then Rule 6 is performed. After an old pod is deleted, it is found that no old pod exists and the scale-in node remains node A. In this case, a new pod will be deleted.
- Where such scale-in works: Assume that the number of nodes is 2 (the same specifications) and the number of Deployment pods is 6 (or any even number). These pods are distributed evenly on nodes A and B. If the number of pods is reduced to 4, the system determines that the Rule 5 is not met. In this case, both nodes A and B will be scaled in. Then, the system performs Rule 6 to sort the pods on the two nodes and deletes two old pods.