How to Use Kubectl Delete Deployment in Kubernetes

In this short article, we will discuss how to use the kubectl delete deployment command in Kubernetes (K8S), explaining how to use it in a step-by-step format with examples.

Photo by Sam Pak on Unsplash

How to use kubectl delete deployment command

  1. Open a terminal or command prompt and connect to your K8S cluster.
  2. View a list of deployments with the kubectl get deployments command. Use the -n <namespace> flag to specify the namespace of the deployment.
  3. Delete the deployment with the kubectl delete deployment <deployment name> -n <namespace name>. For example, if you had a deployment named blog-deployment in the blog namespace, you would run kubectl delete deployment blog-deployment -n blog .

Visit Now

Tags: Delete kubectl