其他分享
首页 > 其他分享> > kubeadm部署-问题解决

kubeadm部署-问题解决

作者:互联网

1.coredns 处于pending 状态

查看具体信息

kubectl describe pod coredns-59d64cd4d4-qgntv -n kube-system

解决方法

安装flannel

有时候一个pod创建之后一直是pending,没有日志,也没有pull镜像,describe的时候发现里面有一句话: 1 node(s) had taints that the pod didn't tolerate.

直译意思是节点有了污点无法容忍,执行  kubectl get no -o yaml | grep taint -A 5   之后发现该节点是不可调度的。

这是因为kubernetes出于安全考虑默认情况下无法在master节点上部署pod,于是用下面方法解决:

kubectl taint nodes --all node-role.kubernetes.io/master-

引用:https://www.cnblogs.com/only-me/p/10219903.html

 

2.Master节点:8080 was refused

报错信息:The connection to the server localhost:8080 was refused - did you specify the right host or port?

 解决方法

步骤一:设置环境变量

echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> /etc/profile

步骤二:使生效

source /etc/profile

 

标签:kubectl,kubernetes,部署,节点,etc,解决,kubeadm,pod,pending
来源: https://www.cnblogs.com/yqgogogo/p/15160151.html