Sobes.tech
Middle+

What is your experience with applying Pod Disruption Budget?

sobes.tech AI

Answer from AI

Used PDB to ensure a minimal number of available application replicas during voluntary disruptions such as node updates or cluster scaling. Configured PDBs both in deployment manifests and as separate PDB objects, specifying minAvailable (absolute or percentage value) or maxUnavailable.

Examples of use:

  • Guarantee availability of n replicas of a StatefulSet during updates.
  • Protect critical Deployments from simultaneous deletion of all pods during node evacuation.
  • In conjunction with Cluster Autoscaler and Horizontal Pod Autoscaler for more controlled scaling and updates.

For example, to ensure at least 80% of Deployment pods are available:

apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
  name: my-app-pdb
spec:
  minAvailable: 80%
  selector:
    matchLabels:
      app: my-app

This PDB prevents voluntary disruptions if the number of available pods falls below 80% of the desired replicas. It helps maintain stability and availability of services during cluster maintenance operations.