# kubectl get node NAME STATUS ROLES AGE VERSION master NotReady control-plane 2m2s v1.28.2 worker1 NotReady <none> 77s v1.28.2 worker2 NotReady <none> 74s v1.28.2
重新初始化集群
如果需要重新初始化集群,执行如下命令:
1
kubeadm reset
手动删除环境配置:
1
rm -rf $HOME/.kube
如果有网络相关配置,还需要注意网络配置的清理。
安装 Cilium
安装 Cilium CLI
首先需要安装 Cilium CLI,它可以用于安装 cilium:
1 2 3 4 5 6 7
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt) CLI_ARCH=amd64 if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
确认 Cilium CLI 安装成功:
1
cilium version --client
安装 Cilium
执行如下命令,安装 Cilium
1
cilium install --version 1.14.4
通过如下命令,确认 Cilium 状态正常:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# cilium status --wait /¯¯\ /¯¯\__/¯¯\ Cilium: OK \__/¯¯\__/ Operator: OK /¯¯\__/¯¯\ Envoy DaemonSet: disabled (using embedded mode) \__/¯¯\__/ Hubble Relay: disabled \__/ ClusterMesh: disabled
# cilium connectivity test ...... ✅ All 44 tests (295 actions) successful, 14 tests skipped, 1 scenarios skipped.
网络插件安装成功后,节点状态也变成 Ready 了:
1 2 3 4 5
# kubectl get nodes NAME STATUS ROLES AGE VERSION master Ready control-plane 28m v1.28.2 worker1 Ready <none> 28m v1.28.2 worker2 Ready <none> 28m v1.28.2