Cleaning up
If you finish playing with your deployment and services or would like to start from the beginning, you can do some cluster cleaning by removing the deployment or services:
$ kubectl delete deployment rest-example$ kubectl delete service rest-example
This code can also be combined in one command, for example:
$ kubectl delete service,deployment rest-exampleThe kubectl delete supports label selectors and namespaces. Let's see some other examples of the command in a table:
Example command | Meaning |
| Delete pods and services with same names |
| Delete pods and services with label |
| Delete all pods and services in namespace |
To stop the minikube cluster, issue simply:
$ minikube stopIf you would like to delete the current minikube cluster, you can issue the following command to do it:
$ minikube delete