WalzoneInterview Prep
📞 Interviewing soon? Practice with a realistic AI mock phone interview — it calls you, then scores you. First 15 min FREE →

Kubernetes · Advanced · question 55 of 100

What is a PodDisruptionBudget (PDB) in Kubernetes and how does it help maintain high availability during cluster maintenance?

📕 Buy this interview preparation book: 100 Kubernetes questions & answers — PDF + EPUB for $5

A PodDisruptionBudget (PDB) is a Kubernetes object that helps to ensure the availability of a workload during disruptive events, such as maintenance or scaling operations, by defining constraints on the number of Pods that can be evicted from a ReplicaSet, Deployment, or StatefulSet at any given time.

PDBs are designed to work with the Kubernetes cluster’s controller manager, which monitors the availability of resources in the cluster and ensures that the desired state is maintained. When a disruptive event occurs, such as a node maintenance or a pod eviction, the controller manager uses the PDBs to determine which Pods can be safely evicted without causing an outage.

To create a PodDisruptionBudget in Kubernetes, you can use a YAML or JSON manifest file, similar to other Kubernetes resources. Here is an example YAML manifest file for a PodDisruptionBudget:

apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
  name: nginx-pdb
spec:
  minAvailable: 2
  selector:
    matchLabels:
      app: nginx

In this example, the PodDisruptionBudget is named "nginx-pdb" and specifies that at least 2 Pods with the label "app: nginx" must be available at all times. If the number of available Pods falls below this threshold, the controller manager will block any further evictions until the desired state is restored.

PDBs are particularly useful in high availability scenarios where workload availability is critical, such as in production environments. By using PDBs, Kubernetes administrators can ensure that their applications remain available even during maintenance or scaling operations, reducing the risk of downtime and improving the overall reliability of the system.

Reading is step one. Saying it out loud is the interview. Our AI interviewer calls your phone and runs a realistic Kubernetes interview — then scores it.
📞 Practice Kubernetes — free 15 min
📕 Buy this interview preparation book: 100 Kubernetes questions & answers — PDF + EPUB for $5

All 100 Kubernetes questions · All topics