我的Ubuntu机器上安装了Kubernetes集群。它由三台机器组成:一台主机/节点和两台节点。
当我关闭群集时,它永远不会停止打印"等待拆除容器":
root@kubernetes01:~/kubernetes/cluster# KUBERNETES_PROVIDER=ubuntu ./kube-down.sh
Bringing down cluster using provider: ubuntu
Identity added: /root/.ssh/id_rsa (/root/.ssh/id_rsa)
No resources found
No resources found
service "kubernetes" deleted
No resources found
waiting for tearing down pods
waiting for tearing down pods
waiting for tearing down pods
waiting for tearing down pods
waiting for tearing down pods
waiting for tearing down pods
waiting for tearing down pods
waiting for tearing down pods
waiting for tearing down pods
waiting for tearing down pods
waiting for tearing down pods
waiting for tearing down pods
waiting for tearing down pods
waiting for tearing down pods
waiting for tearing down pods
waiting for tearing down pods
waiting for tearing down pods
waiting for tearing down pods
关闭时没有播放pod或服务。最后,我必须通过终止进程和停止服务来强制停止。
答案 0 :(得分:6)
首先,我们必须找出正在运行的rc:
kubectl get rc --namespace = kube-system
我们必须删除正在运行的rc:
kubectl delete rc above_running_rc_name --namespace = kube-system
然后群集下来脚本" KUBERNETES_PROVIDER = ubuntu ./kube-down.sh" ;,将执行无错误" 等待拆除广告连播强>"
示例::
root @ ubuntu:〜/ kubernetes / cluster# KUBERNETES_PROVIDER = ubuntu ./kube-down.sh
使用提供程序:ubuntu关闭群集 添加身份:/root/.ssh/id_rsa(/root/.ssh/id_rsa)
找不到资源 找不到资源 服务" kubernetes"删除 找不到资源
等待拆除吊舱
等待拆除吊舱
^ C
root @ ubuntu:〜/ kubernetes / cluster# kubectl get rc --namespace = kube-system 控制器容器(S)IMAGE(S)SELECTOR REPLICAS AGE kubernetes-dashboard-v1.0.1 kubernetes-dashboard gcr.io/google_containers/kubernetes-dashboard-amd64:v1.0.1 k8s-app = kubernetes-dashboard 1 44m root @ ubuntu:〜/ kubernetes / cluster#
root @ ubuntu:〜/ kubernetes / cluster# kubectl delete rc kubernetes-dashboard-v1.0.1 --namespace = kube-system replicationcontroller" kubernetes-dashboard-v1.0.1"删除
root @ ubuntu:〜/ kubernetes / cluster# KUBERNETES_PROVIDER = ubuntu ./kube-down.sh
使用提供程序:ubuntu关闭群集 添加身份:/root/.ssh/id_rsa(/root/.ssh/id_rsa)
找不到资源 找不到资源 服务" kubernetes"删除 找不到资源 在主人172.27.59.208上清洁 26979
等待停止/等待 连接到172.27.59.208关闭。 连接到172.27.59.208关闭。 连接到172.27.59.208关闭。 在节点172.27.59.233上清理 2165 flanneld停止/等待
关闭172.27.59.233的连接。
关闭172.27.59.233的连接。
完成
答案 1 :(得分:2)
您可以通过运行找出等待的播客:
kubectl get pods --show-all --all-namespaces