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):
-
Convert the pod manifest into a controller manifest (run on any machine with kubectl access; edit with your editor of choice):
- Open the exported file:
- Change the top-level
kind: Podto an appropriate controller, e.g.:- For a stateless app:
kind: Deployment,apiVersion: apps/v1 - For a singleton:
kind: Deploymentwithspec.replicas: 1 - For node-wide:
kind: DaemonSet,apiVersion: apps/v1
- For a stateless app:
- Wrap the existing pod
specunder the controller spec, for example for a Deployment: - Remove fields that are not valid under a template (e.g.
status:,metadata.resourceVersion,metadata.uid,metadata.selfLink,metadata.creationTimestamp).
- Open the exported file:
-
Apply the new controller and delete the naked pod (run on any machine with kubectl access):
-
Confirm the controller created replacement pods and workloads are healthy (run on any machine with kubectl access):
-
Re-run the audit to verify no remaining naked pods (run on any machine with kubectl access):
Using kubectl
Using kubectl
On any machine with Adjust the generated
kubectl access:- Identify naked pods (no controller ownerReference, excluding core namespaces):
- For each reported pod, export its spec and remove fields that must not be in a controller template, then wrap it in a Deployment (example for
default myapp-pod):
myapp-deployment.yaml as needed (labels, replicas, affinity, etc.), then create the Deployment:- Once the new controller-created pod is Running and Ready, delete the original naked pod:
- Repeat steps 2–3 for every naked pod, choosing the appropriate controller type (Deployment/StatefulSet/DaemonSet/Job) and adapting the manifest kind and spec accordingly.
- Verification (same logic as the audit):
Automation
Automation

