Skip to main content

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

Informational

Address

Security

Compliance Standards

  • Cloudanix Best Practice

Triage and Remediation

Remediation

Manual Steps

  1. List multi-replica Deployments that currently lack a PodDisruptionBudget (run on any machine with kubectl access):
  2. For one non-compliant Deployment, inspect its spec to identify pod labels and replica count (replace NAMESPACE and DEPLOYMENT with real values from step 1; run on any machine with kubectl access):
    Note the labels under spec.template.metadata.labels and confirm spec.replicas > 1.
  3. Create a PodDisruptionBudget manifest for that Deployment, using the pod template labels as matchLabels and setting an appropriate availability policy (run on any machine with kubectl access):
    Replace:
    • NAMESPACE with the Deployment’s namespace
    • DEPLOYMENT with the Deployment name
    • app: REPLACE_WITH_APP_LABEL_VALUE (and/or add more keys) so that the label set exactly matches spec.template.metadata.labels of the Deployment’s pods. Only matchLabels is evaluated by the check; do not use matchExpressions if you want it counted as compliant.
  4. Apply the PodDisruptionBudget to the cluster (run on any machine with kubectl access):
  5. Repeat steps 2–4 for each remaining non-compliant multi-replica Deployment, ensuring each has a corresponding PodDisruptionBudget whose spec.selector.matchLabels selects that Deployment’s pods.
  6. Verify that all multi-replica Deployments now have at least one matching PodDisruptionBudget (run on any machine with kubectl access):
    Confirm that every kind=Deployment line with replicas= greater than 1 now shows is_compliant=true.