Skip to main content
InterviewHubPRO
Section Overview
Q30

Question 30 of 50

Part 3: Advanced Internals, Scale & Production Security (Senior / Lead)

60%
Kubernetes (K8s) (50 Qs)•Part 3: Advanced Internals, Scale & Production Security (Senior / Lead)

Pod Disruption Budgets (PDB) & Safe Node Maintenance.

senior LevelMost AskedCode ExampleSecurity & AuthKubernetesApache Kafka

In Simple Words: When cloud providers perform node upgrades or when Karpenter drains nodes for bin-packing, pods are evicted:

  • If all 3 replicas of your payment API are evicted simultaneously -> Outage!
  • Pod Disruption Budget (PDB): Enforces high-availability constraints during voluntary disruptions:
    yaml
    apiVersion: policy/v1
    kind: PodDisruptionBudget
    metadata:
      name: payment-api-pdb
    spec:
      minAvailable: 2 # Kubernetes REFUSES to drain a node if it drops healthy pods below 2!
      selector:
        matchLabels:
          app: payment-api
    
    The kubectl drain command blocks safely until replacement pods are running and healthy on another node.