k8s创建完集群之后coredns一直处于pending状态

转载:https://www.cnblogs.com/zhouquan-1992-04-06/p/14925855.html

转载安装calico踩坑:https://blog.csdn.net/moxiaotang/article/details/124790965

按照官网教程https://kubernetes.io/zh/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/,master节点kubectl init,每个从节点kubectl join之后,在master节点执行kubectl get pods -n kube-system,发现coredns一直处于pending状态

 网上找的资料都是安装一个网络插件,怕他们乱写不敢这样做,最后在官网上找到了答案,地址是:https://kubernetes.io/zh/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm/

 最后选择的网络插件是:calico,安装url:https://docs.projectcalico.org/getting-started/kubernetes/self-managed-onprem/onpremises,具体命令:

curl https://docs.projectcalico.org/manifests/calico.yaml -O
kubectl apply -f calico.yaml

执行以上命令默认安装最新版的calico,这里要注意calico要和自己的k8s版本一致,查看calico支持的k8s对应版本可以在calico官网查看
https://projectcalico.docs.tigera.io/archive/v3.20/getting-started/kubernetes/requirements

我使用的k8s:1.17.4对应calico版本为3.14

https://projectcalico.docs.tigera.io/archive/v3.14/getting-started/kubernetes/requirements

执行安装命令为:

curl https://docs.projectcalico.org/v3.14/manifests/calico.yaml -O

 

posted @ 2022-10-20 11:43  锦此  阅读(4966)  评论(0编辑  收藏  举报