K8s add Nodes(join)

環境準備

我準備了兩個 VM 當 K8s work node,加入我的 K8s Lab 叢集環境。 先進行 kubeadm 套件安裝: 安裝 kubeadm:https://fufu.gitbook.io/kk8s/installing-kubeadm#jing-xu-qiu 安裝 CRI-O:https://fufu.gitbook.io/kk8s/installing-crio-kubeadm-init#install-cri-o

因採用非預設的 CRI,故需指定 cgroup-driver

[vagrant@kk8s-1 ~]$ sudo vi /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
Environment="KUBELET_CGROUP_ARGS=--cgroup-driver=systemd"
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS $KUBELET_CGROUP_ARGS

進行 node join

過程中遇到兩個問題,記錄下來:

錯誤1:IPVS proxier will not be used

[WARNING RequiredIPVSKernelModulesAvailable]: 
the IPVS proxier will not be used, because the following required kernel modules are not loaded: 
[ip_vs ip_vs_rr ip_vs_wrr ip_vs_sh] or no builtin kernel ipvs support: 
map[ip_vs:{} ip_vs_rr:{} ip_vs_wrr:{} ip_vs_sh:{} nf_conntrack_ipv4:{}]

you can solve this problem with following methods:
  1. Run 'modprobe -- ' to load missing kernel modules;
  2. Provide the missing builtin kernel ipvs support

經過 Google 搜尋網友經驗,需要下這些指令:

錯誤2:ERROR FileAvailable

這是因為我已經執行數次 join 指令,故已經產生過上述檔案。 透過--ignore-preflight-errors=all即可忽略!

Join 指令

錯誤3:connection to the server localhost:8080 was refused

這是是因為存取不到 API server,需設定本機帳號 API 存取權限

終於完成另一個小里程~經驗與概念又學習到了~

Last updated