What does a PodDisruptionBudget protect and how do you size it?
BeginnerProductionReliability & Rollouts
Answer
It limits voluntary evictions (drains, autoscaler, Karpenter). For a 3-replica service we typically use maxUnavailable: 1, or minAvailable: 2. Avoid minAvailable equal to replicas because it blocks drains forever; for single replicas a PDB is pointless without more replicas.
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata: { name: web }
spec:
maxUnavailable: 1
selector: { matchLabels: { app: web } }
More on Reliability & Rollouts
What are the must-have settings for a production Deployment?BeginnerWhy use image digests or immutable tags instead of `latest`?BeginnerHow do you set graceful shutdown right?BeginnerWhy do rollouts sometimes cause brief 502/503 errors?BeginnerHow many replicas should you run and how do you spread them?BeginnerWhat should a readiness probe check?Beginner