"PodDisruptionBudget" is a Kubernetes object which limits the number pods of a replicated application that are down simultaneously from voluntary disruptions.
Let's say, your microservice is running on a Kubernetes cluster with "PodDisruptionBudget" and configured 2 replicas like this:
apiVersion: apps/v1
kind: Deployment
metadata:
name: your-microservice
namespace: your-namespace
spec:
replicas: 2
...
The cluster has 3 nodes and your microservice's pods "app-1" and "app-2" are running on "node-1" and "node-2":
Now a cluster administrator (Microservices Platform member) is going to drain
node-1 in order to upgrade the cluster:
"app-1" is now terminating and a new pod "app-3" is pending state. At this point, if the cluster administrator tries to drain
"node-2":
What happened? Yes, you don't have any healthy pods now.
PodDisruptionBudget
protects your microservices from this situation.
Now you have same microservice with "PodDisruptionBudget" like this:
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: your-microservice
namespace: your-namespace
spec:
minAvailable: 30%
selector:
matchLabels:
app: your-microservice
# ...
Even if the cluster administrator tries to drain
"node-2", it will block because there is only 1 available pod.
That's why "PodDisruptionBudget" is needed to be configured for your microservices.