PodDisruptionBudget doesn't work with 100% maxUnavailability of pods

Cluster information:

Kubernetes version: Client Version: v1.19.7
Server Version: v1.19.16
Cloud being used: (put bare-metal if not on a public cloud) Rancher
Installation method: Terraform
Host OS: control plane Centos7, worker nodes Centos 8
CNI and version: flannel 0.15.1
CRI and version: docker 20.10.6

My cluster is set up with two different StatefulSet (data-az1 and data-az2), deployed in two different availability zone (AZ1 and AZ2). Is it possible to bring down all the PODS at a time in one availability zone using PodDisruptionBudget (100% maxUnavailable). Suppose for any maintenance activity (i.e nodes upgrade) we want to bring down all the pods in AZ1 and AZ2 will serve the request.

We have tried with data-az1-pdb (100% maxUnavailability) and during upgrade all the pods restarting one by one. We need to somehow force down all the pods in one AZ1 and it should not recreate as part of STS.

Is is possible to bring down all the pods in one AZ using PodDisruptionBudget.

Could anyone please clarify this.

Can anyone please suggest. Is it possible to bring down all the pods at once using PDB.

There a bit of information I think you should take into consideration:

  • I am assuming you will reduce the replica count to 0 on either of the statefulsets manually
  • I do not know the architecture of your software so I encourage you to think about in-transit data loss and corruption if that is an issue

you can use: terminationGracePeriodSeconds to forcefull delete Pod faster meaning when a SIGTERM signal is accepte for a container in a Pod, the grace period can be configured before the container will be forces to stop. That will speed up Pod termination.

Regarding the disruption budget, it is use to protect against voluntary evictions (see link) and will not intentionally terminate your Pod faster (which is what I understand you are attempting to achieve)

Sorry for delayed in response. Thanks for the clarification @Theog75 .

1 Like