PodDisruptionBudget in kubernetes

Hi All,
We create a deployment mentioning the replica set as 4 which means kubernetes will always make sure we should have 4 replicas, what does PodDisruptionBudget actually means.
The Docs says PodDisruptionBudget always used to maintain the minimum number of pods when outage happens. How does these 2 differ?

The number of desired replicas is what you expect to have, like 4 replicas. The pod disruption budget is to prevent voluntary evictions in order to meet the budget that application must absolutely meet.

In other words, it may stop rebooting a node until pods are active in other nodes, etc.

This explained in more detail (what is voluntary eviction, etc.) here: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/

Does it make sense now?

Thanks Rata for the response. We are using AWS EKS, as part of daily shutdown of worker nodes, we turn of the worker nodes at midnight and next day morning we turn on this. So in our case we can’t apply this PDB to any of our pods right?

If you don’t care about uptime, as you are turning off all the nodes, pdb is of no utility in that scenario :slight_smile:

Yes Rata. but will it not affect the nodes when we are turning them off ?

Sorry, don’t follow. Can you please elaborate?

If I set the PDB for a POD and if I try to schedule a daily shutdown of worker nodes, will there be any problem created when the worker node tries to shutdown and the PDB wont allow to shutdown the node?

Don’t think so. You can always shutdown nodes from your provider API. Kubernetes has no way to stop you :slight_smile:

You won’t be able to drain them, if the pdb doesn’t allow, but you can always power off nodes. Unplug is always an option no software can avoid :smiley:

Thank you :slight_smile: