Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot stop 10 containers after Kubernetes minikube tutorial

docker ps screenshot

docker ps

CONTAINER ID        IMAGE                                                  COMMAND                  CREATED             STATUS              PORTS               NAMES
7523fd2c20c7        gcr.io/google_containers/k8s-dns-sidecar-amd64         "/sidecar --v=2 --..."   18 hours ago        Up 18 hours                             k8s_sidecar_kube-dns-86f6f55dd5-qwc6z_kube-system_c1333ffc-e4d6-11e7-bccf-0021ccbf0996_0
9bd438011406        gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64   "/dnsmasq-nanny -v..."   18 hours ago        Up 18 hours                             k8s_dnsmasq_kube-dns-86f6f55dd5-qwc6z_kube-system_c1333ffc-e4d6-11e7-bccf-0021ccbf0996_0
5c35e00a5a27        gcr.io/google_containers/k8s-dns-kube-dns-amd64        "/kube-dns --domai..."   18 hours ago        Up 18 hours                             k8s_kubedns_kube-dns-86f6f55dd5-qwc6z_kube-system_c1333ffc-e4d6-11e7-bccf-0021ccbf0996_0
77ef463642b7        gcr.io/google_containers/pause-amd64:3.0               "/pause"                 18 hours ago        Up 18 hours                             k8s_POD_kube-dns-86f6f55dd5-qwc6z_kube-system_c1333ffc-e4d6-11e7-bccf-0021ccbf0996_0
39f618666205        gcr.io/google_containers/kubernetes-dashboard-amd64    "/dashboard --inse..."   18 hours ago        Up 18 hours                             k8s_kubernetes-dashboard_kubernetes-dashboard-vgpjl_kube-system_c1176a44-e4d6-11e7-bccf-0021ccbf0996_0
023b7b554a8c        gcr.io/google_containers/pause-amd64:3.0               "/pause"                 18 hours ago        Up 18 hours                             k8s_POD_kubernetes-dashboard-vgpjl_kube-system_c1176a44-e4d6-11e7-bccf-0021ccbf0996_0
1c3bdb7bdeb1        gcr.io/google-containers/kube-addon-manager            "/opt/kube-addons.sh"    18 hours ago        Up 18 hours                             k8s_kube-addon-manager_kube-addon-manager-tpad_kube-system_7b19c3ba446df5355649563d32723e4f_0
8a00feefa754        gcr.io/google_containers/pause-amd64:3.0               "/pause"                 18 hours ago        Up 18 hours                             k8s_POD_kube-addon-manager-tpad_kube-system_7b19c3ba446df5355649563d32723e4f_0
b657eab5f6f5        gcr.io/k8s-minikube/storage-provisioner                "/storage-provisioner"   18 hours ago        Up 18 hours                             k8s_storage-provisioner_storage-provisioner_kube-system_c0a8b187-e4d6-11e7-bccf-0021ccbf0996_0
67be5cc1dd0d        gcr.io/google_containers/pause-amd64:3.0               "/pause"                 18 hours ago        Up 18 hours                             k8s_POD_storage-provisioner_kube-system_c0a8b187-e4d6-11e7-bccf-0021ccbf0996_0

I just did the Kubernetes minikube tutorial at https://github.com/kubernetes/minikube, and I cannot stop or remove these containers, they always get recreated.

$ kubectl get deployment
No resource found.

$ minikube status
minikube: Running  
cluster: Running  
kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100

Output of kubectl get pods --all-namespaces

NAMESPACE     NAME                          READY     STATUS    RESTARTS   AGE
kube-system   kube-addon-manager-minikube   1/1       Running   5          19h
kube-system   kube-dns-86f6f55dd5-6kjsn     3/3       Running   15         19h
kube-system   kubernetes-dashboard-68vph    1/1       Running   5          19h
kube-system   storage-provisioner           1/1       Running   5          19h

UPDATE:

I completely removed all packages called 'kube*', removed docker, remove virtualbox, removed /var/lib/docker, reinstalled docker. And the containers are back! How on earth do you get rid of them?

like image 645
viktorsmari Avatar asked Dec 19 '17 17:12

viktorsmari


People also ask

How do I stop all Kubernetes containers?

Stopping the Kubernetes clusterAs the root user, enter the following command to stop the Kubernetes worker nodes: Note: If running in VMWare vSphere, use Shutdown Guest OS. Stop all worker nodes, simultaneously or individually. After all the worker nodes are shut down, shut down the Kubernetes master node.

How do I stop minikube dashboard?

The dashboard command creates a temporary proxy to make the dashboard accessible from outside the Kubernetes virtual network. To stop the proxy, run Ctrl+C to exit the process. After the command exits, the dashboard remains running in the Kubernetes cluster.

How do you destroy the cluster in minikube?

If you want to wipe out your local Minikube cluster and restart, it is very easy to do so. Issuing a command to delete and then start Minikube will wipe out the environment and reset it to a blank slate: minikube deleteDeleting local Kubernetes cluster...


2 Answers

What containers do you want to delete and why? The containers printed in your docker ps output are Kubernetes containers. You basically would destroy minikube by deleting these containers.

In general Kubernetes manages these containers for you. Kubernetes interprets a deleted container as a failure and restarts it. To delete a container you have to delete the pod (or the ReplicaSet, ReplicationController or Deployment depending on your deployed applications).


If these containers actually appear on your host system, then you maybe installed Kubernetes accidentally on your host system (with another tutorial). In this case you have to look for a process called kubelet which creates these containers.

For example if you use systemd:

systemctl status kublet   # see if its actually running
systemctl stop kubelet    # stop it
systemctl disable kubelet # make sure it doesn't start after next reboot
like image 77
svenwltr Avatar answered Sep 30 '22 04:09

svenwltr


If you don't want to run kubernetes then minikube isn't needed and you can stop it and delete it.

minikube stop
minikube delete

Or, if you wan't it running, for some reason, just remove the environment variable DOCKER_HOST that eval $(minikube docker-env) set up for you. It points the docker client to the docker engine in minikube instead of your local machine.

unset DOCKER_HOST

Or, start a new terminal. It won't have the environment variable set.

like image 20
Andreas Wederbrand Avatar answered Sep 30 '22 06:09

Andreas Wederbrand