To delete a deployment in Minikube, you can use the
kubectl delete command. Here is the step-by-step process:
- Open a terminal or a command prompt.
- Make sure you have the Minikube cluster running. If not, start it using the minikube start command.
- Set the context to the Minikube cluster by running the following command:
kubectl config use-context minikube
- List all the deployments in the cluster by running:
kubectl get deployments
This command will display all the deployments along with their names.
- Identify the deployment you want to delete and note down its name.
- Use the kubectl delete deployment command followed by the deployment name to delete it. For example, if the deployment name is 'myapp-deployment', run the following command:
kubectl delete deployment myapp-deployment
This command will delete the specified deployment.
- You can verify if the deployment has been deleted by running kubectl get deployments again. The deployment you just deleted should not be listed.
That's it! The deployment has been successfully deleted from your Minikube cluster.