1. 程式人生 > 其它 >騰訊雲三臺不同區外網部署k8s v1.18叢集問題整理

騰訊雲三臺不同區外網部署k8s v1.18叢集問題整理

一.叢集部署步驟操作:

詳細檢視【許大仙】整理的命令合集,地址:https://www.yuque.com/fairy-era/yg511q/hg3u04

二.部署過程中常見問題

1.kubeadm init ............出現下圖:

這是由於雲網絡型別導致,感興趣可以詳細檢視一下!

解決:

kubeadm init...當檢測到有 etcd.yaml 生成時,立即在另一個視窗編輯修改,命令:

vim /etc/kubernetes/manifests/etcd.yaml

修改檔案中下面三行如下:

# 也就是將多餘的公網ip刪除,將公網ip改為127
- --listen-client-urls=https://127.0.0.1:2379
- --listen-metrics-urls=http://127.0.0.1:2381
- --listen-peer-urls=https://127.0.0.1:2380

解決思路可以檢視這位大佬:https://blog.csdn.net/rdj1314/article/details/119803703

2.coreDns狀態CrashLoopBackOff問題解決

解決方式:https://www.yoyoask.com/?p=2209

3.coredns對應的pod狀態為ContainerCreating

網上搜索一圈無效後又研究了下kubeadm reset命令執行後的輸出結果:

The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d

The reset process does not reset or clean up iptables rules or IPVS tables.
If you wish to reset iptables, you must do so manually by using the "iptables" command.

If your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)
to reset your system's IPVS tables.

The reset process does not clean your kubeconfig files and you must remove them manually.
Please, check the contents of the $HOME/.kube/config file.

然後根據上面的提示把/etc/cni/net.d目錄刪掉,然後重新執行kubeadm init命令就可以了


解決方式:

先執行命令:rm /etc/cni/net.d

再執行kubeadm init xxxxxxx

可以檢視地址:https://blog.csdn.net/john1337/article/details/109352414

3.failed to set bridge addr: "cni0" already has an IP address different from 10.244.1.1/24

解決方法:

將這個錯誤的網絡卡刪掉,它會自己重建,這裡採用刪除重生的方法,首先停用網路,然後刪除配置,命令如下:

    1. ifconfig cni0 down
    2. ip link delete cni0 詳細檢視:https://blog.csdn.net/Wuli_SmBug/article/details/104712653