Duplicate pods / Pods creating without deploy existing

2/18/2020

I'm running into an issue managing my Kubernetes pods.

I had a deploy instance which I removed and created a new one. The pod tied to that deploy instance shut down as expected and a new one came up when I created a new deploy, as expected.

However, once I changed the deploy, a second pod began running. I tried to "kubectl delete pod pod-id" but it would just recreate itself again.

I went through the same process again and now I'm stuck with 3 pods, and no deploy. I removed the deploy completely, and I try to delete the pods but they keep recreating themselves. This is an issue because I am exhausting the resources available on my Kubernetes.

Does anyone know how to force remove these pods? I do not know how they are recreating themselves if there's no deploy to go by.

-- BURGERFLIPPER101
google-kubernetes-engine
kubernetes

1 Answer

2/18/2020

The root cause could be either an existing deployment, replicaset, daemonset, statefulset or a static pod. Check if any of these exist in the affected namespace using kubectl get <RESOURCE-TYPE>

-- Shawlz
Source: StackOverflow