More Info:
Verifies every container sets resources.requests so the scheduler can place the pod correctly and QoS is not BestEffort.Risk Level
LowAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
List all non-exempt pods and identify non-compliant containers
- Run on: any machine with kubectl access
-
For pods owned by higher-level controllers, patch the controller to add requests
- Run on: any machine with kubectl access
- For each non-compliant line with
owner=<Kind>/<namespace>/<name>/..., edit that owner, not the pod. Example for a Deployment:
- Adjust
NAMESPACE,DEPLOYMENT_NAME,CONTAINER_NAME, and choose CPU/memory values appropriate for the workload.
-
For standalone Pods (no owner), export, edit, and re-apply with requests
- Run on: any machine with kubectl access
- Edit
/tmp/pod-POD_NAME.yamland under each affected container add, or update, for example:
- Delete and recreate the pod from the edited manifest (standalone pods only):
-
For controllers managed via GitOps or IaC, update the source manifests
- Run in your Git/IaC workflow; apply from any machine with kubectl access.
- In each manifest (e.g., Deployment/StatefulSet/DaemonSet), ensure every container under
spec.template.spec.containersdefinesresources.requests.cpuandresources.requests.memoryas in step 3, then apply:
-
Wait for rollouts to complete
- Run on: any machine with kubectl access
-
Verification (re-run the audit and confirm no
is_compliant=false)- Run on: any machine with kubectl access
- Confirm there are no lines with
is_compliant=false.
Using kubectl
Using kubectl
On any machine with kubectl access:For each line, note:If the target container is not index 0, get its index first:Then use that index instead of Again, adjust the container index as needed using:Then apply:
- Identify non-compliant Pods and their controllers
ownerKind/ownerNameif present (Deployment, StatefulSet, DaemonSet, Job, CronJob, etc.).- If no ownerKind, you will edit the Pod template directly where it is defined (usually a standalone Pod manifest).
- Patch a controller-managed workload (example: Deployment)
NAMESPACE, DEPLOYMENT_NAME, CONTAINER_NAME, and the CPU/memory values with your desired requests. This modifies the Pod template so all new Pods are compliant.0 in the JSON patch path.For other controllers, use the corresponding kind:- Patch a standalone Pod (not recommended long term but possible)
ownerKind/ownerName, you must edit the source manifest and re-apply it. If you only have the live object, you can patch it (changes are lost when the Pod is recreated):- Prefer declarative manifests for ongoing management
- Verification
Automation
Automation

