More Info:
Verifies every container sets resources.limits.cpu and resources.limits.memory so a single workload cannot exhaust a node.Risk Level
MediumAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify noncompliant pods and their owning workloads (run on any machine with kubectl access):
-
For each owning workload (e.g., Deployment, StatefulSet, DaemonSet, Job, CronJob) that has noncompliant containers, export its manifest (run on any machine with kubectl access, substitute actual values):
(Replace
deploymentwith the actual kind, e.g.statefulset,daemonset,job,cronjobas needed.) -
Edit the exported manifest to set CPU and memory limits on every container in the pod template (run on any machine with kubectl access, using your editor of choice, example with
vi):Under each.spec.template.spec.containers[].resources, ensure you have both:Ifresourcesorlimitsis missing, add these sections. Set values according to your application requirements and node capacities. -
Apply the updated manifest back to the cluster (run on any machine with kubectl access):
Repeat steps 2–4 for each noncompliant owning workload identified in step 1.
-
For standalone Pods without a controller (no ownerKind/ownerName in step 1 output), recreate them with limits set:
- Get the current pod spec:
- Edit
/tmp/pod-POD_NAME.yamlto addresources.limits.cpuandresources.limits.memoryfor every container as in step 3, and remove cluster-assigned fields (e.g.metadata.resourceVersion,metadata.uid,metadata.creationTimestamp,statusblock). - Delete and recreate the pod (run on any machine with kubectl access):
- Get the current pod spec:
-
Verify all non-excluded pods are now compliant (run on any machine with kubectl access):
Using kubectl
Using kubectl
On any machine with kubectl access:Focus on the owning controller kinds such as Deployment, StatefulSet, DaemonSet, Job, CronJob; editing those will fix their pods.Under each Save and exit; Kubernetes will roll out updated pods.Repeat for all controllers that create non-compliant pods.Edit Then delete and recreate:Non-compliant containers will show
- Identify non-compliant pods and their controllers
- Edit a workload to add limits (example for a Deployment)
spec.template.spec.containers[], add both cpu and memory limits, for example:- Apply limits via manifest (declarative)
resources block under each container, then apply:- For standalone Pods (no controller)
Pod (no higher-level controller), you must recreate them because pod specs are immutable:/tmp/your-pod.yaml:- Remove fields under
metadatasuch asuid,resourceVersion,creationTimestamp,managedFields,selfLink,generation. - Remove
statuscompletely. - Under each
spec.containers[], add:
- Verification
limitsCpu=unset or limitsMemory=unset; adjust remaining workloads until all are compliant.Automation
Automation

