1.根據 https://github.com/cookeem/kubeadm-ha/blob/master/README_CN.md 去搭建ha集群,遇到幾個問題:
runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Readiness probe failed: Get http://10.2.1.126:9099/readiness: dial tcp 10.2.
由於先kubeadm初始化 再安裝calico網絡組件 $ kubectl apply -f calico/
導致get nodes 時總是notready,再安裝完caloco組件后就變成ready
2.Warning FailedMount 1m (x14 over 13m) kubelet, master2
MountVolume.SetUp failed for volume "timezone" : hostPath type check failed: /etc/timezone is not a file
這是由於
/etc/timezone不是文件而是文件夾導致的,刪除后改為文件就可以
3發現一個有用的命令:
journalctl -u kubelet --no-pager
通過journalctl -u kubelet.service命令來查看kubelet服務的日志