Interview Prep/Kubernetes/Pods & Workloads

How does the ReplicaSet controller decide which Pod to delete when scaling down?

AdvancedConceptPods & Workloads
Answer

It ranks Pods: unscheduled before scheduled, Pending before Running, not-Ready before Ready, Pods on nodes with more replicas of the same set first, newer Ready times first, higher restart counts first. This favors removing the least useful Pods and spreading survivors. You can influence it with the controller.kubernetes.io/pod-deletion-cost annotation.

All Kubernetes questions Roadmap: Kubernetes core

More on Pods & Workloads