要检查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已成功安装。