I have started pods with command
$ kubectl run busybox \
--image=busybox \
--restart=Never \
--tty \
-i \
--generator=run-pod/v1
Something went wrong, and now I can't delete this Pod
.
I tried using the methods described below but the Pod
keeps being recreated.
$ kubectl delete pods busybox-na3tm
pod "busybox-na3tm" deleted
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
busybox-vlzh3 0/1 ContainerCreating 0 14s
$ kubectl delete pod busybox-vlzh3 --grace-period=0
$ kubectl delete pods --all
pod "busybox-131cq" deleted
pod "busybox-136x9" deleted
pod "busybox-13f8a" deleted
pod "busybox-13svg" deleted
pod "busybox-1465m" deleted
pod "busybox-14uz1" deleted
pod "busybox-15raj" deleted
pod "busybox-160to" deleted
pod "busybox-16191" deleted
$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
default busybox-c9rnx 0/1 RunContainerError 0 23s
kubectl get all -o name
? – Noamikubectl get events
to see what is creating these objects? – Varunakubctl get rc
to see if a ReplicationController was created. If so, delete that, then delete the pods. – Sapheadedkubectl get deployment
– Beige# kubectl version
-> v1.2.0#kubectl get events
--> "Error syncing pod, skipping: failed to "StartContainer" for "busybox" with RunContainerError: "runContainer: API error (500): Container command not found or does not exist.\n"# kubectl get rc
--> shows nothing#kubectl get deployment
--> shows nothing ----- It looks like it got stuck in downloading image. I wonder how I can delete or stop this container.#kubectl get pods
NAME READY STATUS RESTARTS AGE busybox-zehyn 0/1 ContainerCreating 0 8s – Wristkubectl delete deployment <deployment_name>
. To get the deployment name, dokubectl get deployments
– Holozoic