Sobes.tech
Middle+

What is PodDisruptionBudget?

sobes.tech AI

Answer from AI

PodDisruptionBudget (PDB) is an object in Kubernetes that specifies the minimum number of pods that must remain available during planned disruptions, such as node updates or manual administrator actions.

PDB helps control the level of application availability, preventing too many pods from being shut down simultaneously. This is especially important for high-load or highly available services.

Example of a PDB in YAML:

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

In this example, Kubernetes will not allow more than one pod with the label app: myapp to be taken down at the same time, ensuring at least 2 pods are always available.

Thus, PDB provides a balance between the need for updates and maintaining application operability.