From bdebd9895f5a93da02cc0266f7902986459c5dad Mon Sep 17 00:00:00 2001 From: Matt Fischer Date: Sat, 18 Jun 2016 10:29:10 -0600 Subject: [PATCH] nginx service/deployment needs to be cleanedup If you plan on recreating the nginx service & deployment you need to remove both or kubernetes will refuse to rebuild them. Otherwise you get this error: root@compute3:~# kubectl run nginx --image=nginx --port=80 Error from server: deployments.extensions "nginx" already exists Additionally this commit fixes the numbering in the deleted section. The numbered list restarts at 1 due to the indented code, so a simple work around is to escape the period in the numbered list. --- docs/getting-started-guides/docker.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/getting-started-guides/docker.md b/docs/getting-started-guides/docker.md index 8efa8ad4e1..34445cdd64 100644 --- a/docs/getting-started-guides/docker.md +++ b/docs/getting-started-guides/docker.md @@ -162,14 +162,22 @@ See [here](/docs/getting-started-guides/docker-multinode/deployDNS/) for instruc ### Turning down your cluster -1. Delete all the containers including the kubelet: +1\. Delete the nginx service and deployment: + +If you plan on re-creating your nginx deployment and service you will need to clean it up. + +```shell +kubectl delete service,deployments nginx +``` + +2\. Delete all the containers including the kubelet: Many of these containers run under the management of the `kubelet` binary, which attempts to keep containers running, even if they fail. So, in order to turn down the cluster, you need to first kill the kubelet container, and then any other containers. You may use `docker rm -f $(docker ps -aq)`, note this removes _all_ containers running under Docker, so use with caution. -2. Cleanup the filesystem: +3\. Cleanup the filesystem: On OS X, first ssh into the docker VM: