要檢查Ubuntu上kubeadm的安裝狀態,請按照以下步驟操作:
打開終端(Terminal)。
輸入以下命令以查看kubeadm的版本信息:
kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.5", GitCommit:"6b1d87acf3c8253c123756b9e61dac642678305f", GitTreeState:"clean", BuildDate:"2021-03-18T01:10:43Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}
請注意,具體的版本號可能會有所不同。
The program 'kubeadm' is currently not installed. You can install it by typing:
sudo apt install kubeadm
在這種情況下,您需要先安裝kubeadm。您可以使用以下命令安裝kubeadm:
sudo apt update && sudo apt install -y apt-transport-https curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
sudo apt update
sudo apt install -y kubelet kubeadm kubectl
sudo apt-mark hold kubelet kubeadm kubectl
完成后,再次運行kubeadm version
以確認kubeadm已成功安裝。