k8s 排错

问题1:

lookup production.cloudflare.docker.com on 223.5.5.5:53: server misbehaving

解决:更改dns

vim /etc/resolv.conf

改成了8.8.8.8

 

问题2:

删除namespace 一直处于Terminating状态

解决:强制删除

[root@k8s-master example-nodeport-cluster]# kubectl get ns
NAME STATUS AGE
default Active 35d
ingress-nginx Active 20d
kube-node-lease Active 35d
kube-ops Active 11d
kube-public Active 35d
kube-system Active 35d
kubernetes-dashboard Terminating 35d
monitoring Active 11d

 

kubectl get ns kubernetes-dashboard -o json > kubernetes-dashboard-sytem.json

vim kubernetes-dashboard-sytem.json

 

开一个新的terminer窗口启动kubectl proxy

[root@k8s-master example-nodeport-cluster]# kubectl proxy
Starting to serve on 127.0.0.1:8001

再次尝试namespace

curl -k -H "Content-Type: application/json" -X PUT --data-binary @kubernetes-dashboard-sytem.json http://127.0.0.1:8001/api/v1/namespaces/kubernetes-dashboard/finalize

 

再次查看namespace

[root@k8s-master example-nodeport-cluster]# kubectl get namespace
NAME STATUS AGE
default Active 35d
ingress-nginx Active 20d
kube-node-lease Active 35d
kube-ops Active 11d
kube-public Active 35d
kube-system Active 35d
monitoring Active 11d

删除完成

 

 

posted @ 2020-07-23 14:43  qinliang  阅读(510)  评论(0编辑  收藏  举报