DEV Community

Cover image for How to delete a kubernetes deployment with kubectl
Adrian Matei for Codever

Posted on • Edited on • Originally published at codever.dev

2 2

How to delete a kubernetes deployment with kubectl

First select the deployment name in the current context you, if you don't know it with the following command:

kubectl get deploy
Enter fullscreen mode Exit fullscreen mode

You should get a list of deployments similar to the following:

NAME                                       READY   UP-TO-DATE   AVAILABLE   AGE
pdv-location-batch-test                    0/1     1            0           2m12s
connector-partner-service                  1/1     1            1           330d
Enter fullscreen mode Exit fullscreen mode

Then use kubectl delete deploy <deployment name> to delete the deployment, in my case pdv-location-batch-test was the deployment I was looking for:

kubectl delete deploy pdv-location-batch-test
Enter fullscreen mode Exit fullscreen mode

You should get something similar to the following:

deployment.apps "pdv-lokation-batch-test" deleted
Enter fullscreen mode Exit fullscreen mode

Shared with ❤️ from Codever. Use 👉 copy to mine functionality to add it to your personal snippets collection.

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay