Sobes.tech
Middle — Middle+

What does the concept of Budget mean for pod interruptions in Kubernetes and how does it affect cluster components?

sobes.tech AI

Answer from AI

In Kubernetes, the concept of Pod Disruption Budget (PDB) is a mechanism that sets limits on the number of pods that can be simultaneously disrupted (for example, due to updates, scaling, or failures). PDB helps ensure a minimum level of application availability during planned or unplanned disruptions.

A PDB defines the minimum number of pods that must remain available, or the maximum number of pods that can be unavailable at the same time. This affects the operation of cluster components, such as update controllers (e.g., Deployment), which consider the PDB when deciding how many pods can be safely deleted or restarted.

Example of a PDB in YAML:

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

This specifies that at least 2 pods with the label app: myapp must always be available. If the number of available pods drops below this value, Kubernetes will not allow additional pods to be disrupted, helping to prevent complete application downtime.