More Info:
Verifies pods are owned by a controller (Deployment, StatefulSet, DaemonSet, Job). A naked pod is not rescheduled if its node dies.Risk Level
LowAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify naked pods (run on any machine with kubectl access):
-
For each naked pod, export its manifest (run on any machine with kubectl access):
-
Create a controller manifest from the pod spec (run on any machine with kubectl access; edit file with your editor of choice):
- Open the exported file:
- Remove
metadata.uid,resourceVersion,creationTimestamp,status, and anyownerReferences. - Wrap the
specunder a controller. For a typical Deployment, change the top-level keys to something like: - Adjust to
StatefulSet,DaemonSet, orJobif more appropriate for the workload.
- Open the exported file:
-
Apply the new controller (run on any machine with kubectl access):
-
Delete the original naked pod after confirming the controller-created pod is running (run on any machine with kubectl access):
-
Verify no remaining naked pods (run on any machine with kubectl access):
Using kubectl
Using kubectl
On any machine with kubectl access:Edit Apply it:Apply and remove the naked pod:
- Identify naked pods (non-system namespaces)
- For each naked pod, export its spec as a template (example for namespace
app-ns, podmy-app-pod):
my-app-pod.yaml locally:- Remove fields that must not be in a controller spec:
metadata.uidmetadata.resourceVersionmetadata.creationTimestampmetadata.ownerReferencesmetadata.managedFieldsmetadata.selfLink,metadata.generation(if present)spec.nodeName(unless you intentionally pin to a node; usually remove)statussection (remove entirely)
- Decide the right controller type:
- Deployment for stateless apps
- StatefulSet for stateful apps needing stable identity
- DaemonSet to run one pod per node
- Job for finite work/batch
- Example: convert to a Deployment (stateless workload)
my-app-pod.yaml into my-app-deployment.yaml like:- Scale down and delete the original naked pod
- Label the old pod so you can distinguish it (optional):
- Once the Deployment pod is Ready, delete the naked pod:
- Example: convert to a Job (for one-off/batch pods)
my-batch-job.yaml:- Verification (same logic as the audit)
Automation
Automation

