Kubernetes minikube教程后无法停止10个容器 [英] Cannot stop 10 containers after Kubernetes minikube tutorial
问题描述
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教程. ,而且我无法停止或删除这些容器,因此它们总是会被重新创建.
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
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. 容器又回来了!你到底如何摆脱它们?
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?
推荐答案
您要删除哪些容器,为什么?在docker ps
输出中打印的容器是Kubernetes容器.您基本上可以通过删除这些容器来破坏minikube.
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.
通常,Kubernetes为您管理这些容器. Kubernetes将已删除的容器解释为失败并重新启动它.要删除容器,您必须删除容器(或ReplicaSet,ReplicationController或Deployment(取决于部署的应用程序)).
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).
如果这些容器实际上出现在您的主机系统上,则可能是您在主机系统上意外地安装了Kubernetes(带有另一个教程).在这种情况下,您必须寻找一个名为kubelet
的过程来创建这些容器.
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.
例如,如果您使用systemd:
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
这篇关于Kubernetes minikube教程后无法停止10个容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!