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
我刚刚在https://github.com/kubernetes/minikube做了Kubernetes minikube教程,我无法停止或删除这些容器,它们总是被重新创建。
$ kubectl get deployment
No resource found.
$ minikube status
minikube: Running
cluster: Running
kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100
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
更新:
我完全删除了所有名为'kube *'的软件包,删除了docker,删除了virtualbox,删除了/ var / lib / docker,重新安装了docker。 容器又回来了!你到底怎么摆脱它们?
答案 0 :(得分:3)
您要删除哪些容器?为什么?在docker ps
输出中打印的容器是Kubernetes容器。你基本上会通过删除这些容器来销毁minikube。
一般来说,Kubernetes会为您管理这些容器。 Kubernetes将已删除的容器解释为失败并重新启动它。要删除容器,您必须删除容器(或ReplicaSet,ReplicationController或部署,具体取决于您部署的应用程序)。
如果这些容器实际出现在您的主机系统上,那么您可能会在主机系统上意外安装Kubernetes(使用另一个教程)。在这种情况下,您必须查找名为kubelet
的过程,该过程会创建这些容器。
例如,如果您使用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
答案 1 :(得分:1)
如果您不想运行kubernetes,则不需要minikube,您可以将其停止并删除。
minikube stop
minikube delete
或者,如果您要运行它,出于某种原因,只需删除eval $(minikube docker-env)
为您设置的环境变量DOCKER_HOST即可。它将docker客户端指向minikube中的docker引擎而不是本地计算机。
unset DOCKER_HOST
或者,启动一个新终端。它不会设置环境变量。