---
name: "kubernetes-pdb-disruption-budgets"
description: "Guarantee minimum pod availability during voluntary node drains and cluster upgrades."
metadata:
  author: "Kubernetes"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "create pod disruption budget"
  - "configure pdb minavailable"
  - "safe k8s node drain"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Kubernetes PDB (PodDisruptionBudget) High Availability

Configures PodDisruptionBudget (PDB): defining minAvailable and maxUnavailable thresholds, matching pod label selectors, preventing cluster outages during EKS/GKE version upgrades, and handling evictions safely.

## When to Invoke
Invoke this skill whenever you need to:
- create pod disruption budget
- configure pdb minavailable
- safe k8s node drain

## Execution SOP & Rules
1. Define apiVersion: policy/v1, kind: PodDisruptionBudget with matching spec.selector.
2. Set minAvailable: 2 or minAvailable: '75%' (never set minAvailable: 100% on small deployments).
3. Test eviction protection: kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data.
4. Verify PDB status: kubectl get pdb to check ALLOWED DISRUPTIONS column.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
