我有一个问题,也许很容易,但我无法处理。如何从本地机器中删除所有 k8s 容器和图像?
gcr.io/google_containers/k8s-dns-sidecar-amd64 Up 36 minutes k8s_sidecar_kube-dns-6fc954457d-mwgvb_kube-system_fd5ebaed-c63c-11e7-b3c8-28d24484a79b_116
gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64 Up 36 minutes k8s_dnsmasq_kube-dns-6fc954457d-mwgvb_kube-system_fd5ebaed-c63c-11e7-b3c8-28d24484a79b_116
gcr.io/google_containers/k8s-dns-kube-dns-amd64 Up 36 minutes k8s_kubedns_kube-dns-6fc954457d-mwgvb_kube-system_fd5ebaed-c63c-11e7-b3c8-28d24484a79b_116
gcr.io/google_containers/kubernetes-dashboard-amd64 Up 36 minutes k8s_kubernetes-dashboard_kubernetes-dashboard-xpg2v_kube-system_fd403866-c63c-11e7-b3c8-28d24484a79b_222
gcr.io/google-containers/kube-addon-manager Up 36 minutes k8s_kube-addon-manager_kube-addon-manager-lenovo-e540_kube-system_9831e93c3188555873fdb49f43198eef_186
gcr.io/google_containers/pause-amd64:3.0 Up 36 minutes k8s_POD_kube-dns-6fc954457d-mwgvb_kube-system_fd5ebaed-c63c-11e7-b3c8-28d24484a79b_116
gcr.io/google_containers/pause-amd64:3.0 Up 36 minutes k8s_POD_kube-addon-manager-lenovo-e540_kube-system_9831e93c3188555873fdb49f43198eef_186
gcr.io/google_containers/pause-amd64:3.0 Up 36 minutes k8s_POD_kubernetes-dashboard-xpg2v_kube-system_fd403866-c63c-11e7-b3c8-28d24484a79b_186
无法阻止它们(它们总是重新启动),也无法通过rm
and删除它们rmi
。还想杀人kubelet
。
$ ps ax | grep kubelet
17234 pts/18 S+ 0:00 grep --color=auto kubelet
$ kill -KILL 17234
bash: kill: (17234) - No such process
systemctl stop kubelet
Failed to stop kubelet.service: Unit kubelet.service not loaded.
还试图强制删除此容器:
$ docker rm -f $(docker ps -a -q --filter "name=k8s")
但他们会在那之后重新创建......
像这样检查可用的 pods 结果...
$ kubectl get po -n=kube-system
Unable to connect to the server: dial tcp 192.168.99.100:8443: getsockopt: network is unreachable
我在文档、堆栈等中寻找它,但没有任何效果。
这是github上的错误,但没有人可以提供帮助:https ://github.com/kubernetes/kubernetes/issues/61173
提前致谢!
最好的问候, 马辛