Reputation: 4950
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?
Upvotes: 4
Views: 1823
Reputation: 8461
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.
Upvotes: 4