In this article, I will show you how to delete the deployment using kubectl.
A Deployment provides declarative updates for Pods and ReplicaSets. You describe the desired state in a Deployment, and the Deployment controller changes the actual state to the desired state at a controlled rate. You can define Deployments to create new ReplicaSets or to remove existing Deployments and adopt all their resources with new Deployments.
You might also like: kubectl stop all pods
How to delete the deployment using kubectl
Let’s see how we can delete the deployment. You can use the following command.
kubectl delete deployments --namespace default <deployment-name>
The above command will delete the deployment
How to delete all deployments in the namespace
**Note: Please be careful to execute the following command. It will delete all the deployments in the given namespace. **
Now let’s see how to delete all the deployments in the specified namespace.
kubectl delete --all deployments --namespace default
If you have any questions/ suggestions please feel free to comment below.