Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I undo a kubectl create deploy?

I was setting up a nginx cluster on google cloud, and I entered a wrong image name; instead of entering:

kubectl create deploy nginx --image=nginx:1.17.10

I entered:

kubectl create deploy nginx --image=1.17.10

and eventually after running kubectl get pods, It showed ImagePullBackOff as the status for the pod.

When I tried running the correct create deploy command above, It said "nginx" already exists.

When I tried doing kubernetes delete --all pods, the pod was recreated with a new ID but still had the same status, and still couldn't allow me to run the right 'kubectl create deploy' command above. Now I'm stuck.

How can I undo it?

like image 566
pintert3 Avatar asked Aug 15 '26 06:08

pintert3


1 Answers

You need to delete the deployment:

kubectl delete deploy nginx

Otherwise Kubernetes will recreate the pod on every shutdown.

You can see all your deployments with

kubectl get deploy 
like image 115
Chris Avatar answered Aug 16 '26 19:08

Chris