Skip to main content

More Info:

Verifies every container sets resources.requests so the scheduler can place the pod correctly and QoS is not BestEffort.

Risk Level

Low

Address

Security

Compliance Standards

  • Cloudanix Best Practice

Triage and Remediation

Remediation

Manual Steps

  1. Identify non-compliant pods (run on any machine with kubectl access):
  2. For a non-compliant pod owned by a higher-level controller (Deployment/StatefulSet/DaemonSet), edit the controller so all containers set CPU and memory requests (run on any machine with kubectl access). Example for a Deployment:
    In each container under spec.template.spec.containers[], add or update:
    Choose values appropriate for your workload.
  3. For a non-compliant pod created directly (no controller owner), edit the Pod spec (run on any machine with kubectl access). Note this will delete and recreate the Pod:
    Under each spec.containers[], add or update:
    Then recreate:
  4. For workloads managed via manifests or GitOps, update the source YAML so changes persist (run on your manifest/IaC repository, then apply from any machine with kubectl access):
    Then apply:
  5. Wait for updated workloads to roll out and pods to be recreated (run on any machine with kubectl access):
  6. Verify compliance (run on any machine with kubectl access):
    Ensure either the output is is_compliant=true or every listed container shows is_compliant=true.
On any machine with kubectl access:
  1. Identify non‑compliant pods and their controllers
Focus on the ownerKind/ownerName (Deployment, StatefulSet, Job, etc.). Edit the controller, not the live pod.
  1. Edit a controller to add requests (example: Deployment)
Edit /tmp/deploy-with-requests.yaml and, for each container under spec.template.spec.containers, add a resources.requests block, for example:
Apply the updated manifest:
This will roll pods for that Deployment as the template changes.
  1. Edit other owner types similarly (examples)
StatefulSet:
DaemonSet:
CronJob (template is nested):
Edit:
Apply:
For standalone Pods created directly (ownerKind=Pod), either:
  • Edit in place (ephemeral; lost if pod is recreated by external system):
  • Or better, manage them via a controller manifest going forward.
Operational impact: changing a controller’s pod template will trigger a rollout and recreate pods; ensure this is acceptable and coordinate if needed.
  1. Verification
Run the benchmark audit command again from any machine with kubectl access: