More Info:
Advisory: define a PodDisruptionBudget for each multi-replica Deployment so node drains and rollouts keep a minimum number of pods available.Risk Level
InformationalAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify multi-replica Deployments that lack a PodDisruptionBudget
Run on: any machine with kubectl access -
For one non-compliant Deployment, capture its labels to use in the PodDisruptionBudget selector
Run on: any machine with kubectl access
Replace NAMESPACE and DEPLOYMENT_NAME as needed:Note the key/value pairs; these must be copied exactly into the PodDisruptionBudget’sspec.selector.matchLabels. -
Decide the availability requirement for this Deployment and choose the PodDisruptionBudget spec
Run on: any machine with kubectl access
Typical choices:- To always keep at least one pod running:
- Or to allow only 1 pod at a time to be disrupted in a 3+ replica Deployment:
.spec.replicasfor this Deployment. - To always keep at least one pod running:
-
Create a PodDisruptionBudget manifest for the Deployment using its pod labels
Run on: any machine with kubectl access
Example template; replace NAMESPACE, PDB_NAME, and the labels undermatchLabelswith the exact values from step 2:EnsurematchLabelsmatches a subset of the pod template labels of the target Deployment so the PDB actually selects its pods. -
Apply the PodDisruptionBudget to the cluster
Run on: any machine with kubectl access -
Verification: confirm all multi-replica Deployments now have at least one matching PodDisruptionBudget
Run on: any machine with kubectl accessEnsure all listed Deployments showis_compliant=true; if any showis_compliant=false, repeat steps 2–5 for those Deployments.
Using kubectl
Using kubectl
On any machine with kubectl access:Note the pod template labels under
- Identify a multi‑replica Deployment needing a PDB (example: namespace
production, deploymentweb-app):
spec.template.metadata.labels. Example:- Create a PodDisruptionBudget manifest that selects those labels and enforces a minimum number of available pods. Example (adjust labels, name, and minAvailable/maxUnavailable per your SLOs):
- Apply the PDB:
-
Repeat steps 1–3 for each Deployment with
spec.replicas > 1, ensuring each PDB’sspec.selector.matchLabelsexactly matches the Deployment’s pod template labels. - Verification (cluster‑wide, same logic as the audit):
Automation
Automation

