Skip to main content

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

Low

Address

Security

Compliance Standards

  • Cloudanix Best Practice

Triage and Remediation

Remediation

Manual Steps

  1. List naked pods (no owner controller) excluding system namespaces (run on any machine with kubectl access):
  2. For each naked pod, export its full spec to a manifest file (run on any machine with kubectl access):
  3. Create a Deployment manifest from the pod spec (typical case; run on any machine with kubectl access):
    • Open the exported file in an editor and transform it into a Deployment, saving as example-pod-deploy.yaml:
    • Adjust fields (e.g., replicas, labels, scheduling settings) to match the intent of the original pod.
    • If the workload is better suited for a different controller (e.g., DaemonSet for one pod per node, StatefulSet for stable identities, Job for run-to-completion), construct that controller instead of a Deployment but still based on the original pod’s spec.template.
  4. Apply the new controller manifest (run on any machine with kubectl access):
  5. After confirming the new controller-created pod is Running and functioning, delete the original naked pod (run on any machine with kubectl access):
  6. Verify no remaining naked pods (run on any machine with kubectl access):
On any machine with kubectl access:
  1. Identify naked pods (excluding GKE system namespaces):
For each <namespace> <pod-name> pair below, create a controller.
  1. Export the naked pod spec (example for one pod):
  1. Create a Deployment manifest from the pod (most common case):
Fill in POD_NAME, NAMESPACE, CONTAINER_NAME, IMAGE, and any other fields from /tmp/pod-POD_NAME.yaml.Apply the Deployment:
Wait for the new pod to be ready:
Delete the original naked pod:
  1. If the workload needs a different controller type, create that instead:
  • Long-running replicated: kind: Deployment
  • One-per-node: kind: DaemonSet
  • Ordered or with stable network/storage IDs: kind: StatefulSet
  • Finite / batch: kind: Job or kind: CronJob
Use the same pattern: build a manifest whose .spec.template matches the original pod’s .spec, then kubectl apply -f and delete the naked pod.
  1. Verification (same as audit command):