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. Identify multi-replica Deployments and their labels (run on any machine with kubectl access)
  2. Decide the minimum available pods for each Deployment (planning step)
    For each multi-replica Deployment, choose either:
    • minAvailable: minimum number of pods that must stay available during disruptions, or
    • maxUnavailable: maximum number or percentage of pods that can be disrupted at once.
      Ensure the value makes sense for the workload’s availability/SLO requirements.
  3. Create a PodDisruptionBudget manifest that matches the pod labels (run on any machine with kubectl access)
    Create a file such as pdb-<deployment-name>.yaml with matchLabels exactly matching the pod template labels from step 1 (do not use matchExpressions, as the audit ignores them). Example structure:
  4. Apply the PodDisruptionBudget to the cluster (run on any machine with kubectl access)
  5. Confirm that each PDB selector correctly matches pods from its Deployment (run on any machine with kubectl access)
  6. Verify compliance using the benchmark audit logic (run on any machine with kubectl access)
    Ensure every multi-replica Deployment reports is_compliant=true.
On any machine with kubectl access:
  1. Identify multi‑replica Deployments and their labels
  1. Create a PodDisruptionBudget manifest matching the Deployment’s pod labels
Example (edit namespace, name, and labels to match your Deployment):
Apply it:
Repeat as needed so each Deployment with .spec.replicas > 1 has at least one PDB whose spec.selector.matchLabels is a subset of the pod template labels for that Deployment.
  1. Verification
Re‑run the audit (any machine with kubectl access):