Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pod deletion policy when scaling down the deployment?

Is there a way to tell k8s to delete the oldest pods in the deployment first?

For instance I have a deployment which consist of 3 pods. I then decided to scale it up by adding 3 more pods:

kubectl scale deployment some-deployment --replicas=6

After finishing my tests I want it to be 3 pods again, so I scale it down:

kubectl scale deployment some-deployment --replicas=3

Is there a way to configure deployment in a way so that during the scale down process the oldest pods would be removed first? What if I need it the other way around, delete more recent pods first?

like image 570
NarūnasK Avatar asked Nov 02 '25 16:11

NarūnasK


1 Answers

This is an open issue. You may find this related item interesting. Currently you are not able to do it. Let's hope it will be fixed soon.

like image 173
2 revs, 2 users 86%VKR Avatar answered Nov 04 '25 07:11

2 revs, 2 users 86%VKR



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!