// 安装所需要的包

sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl

// 下载 Google Cloud 公开签名秘钥(阿里云镜像):

curl -fsSL https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-archive-keyring.gpg

// 添加 Kubernetes apt 仓库(阿里云镜像):

echo "deb [signed-by=/etc/apt/keyrings/kubernetes-archive-keyring.gpg] https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list

安装 kubelet、kubeadm 和 kubectl,并锁定其版本:

sudo apt update
sudo apt install -y kubelet kubeadm kubectl
sudo apt-mark hold kubelet kubeadm kubectl

官方文档:https://kubernetes.io/zh/docs/setup/production-environment/tools/kubeadm/install-kubeadm/

Logo

开源、云原生的融合云平台

更多推荐