环境:阿里云虚拟机Ubuntu系统

问题一:安装k8s时报错

症状:要么抛出异常提示Unable to locate package kubectl,要么提示

The repository ‘https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial InRelease’ is not signed

依序解决:

使用国内镜像1echo "deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list

安装GPG秘钥2curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg |sudo apt-key add -

sudo apt-get update
apt-get install -y kubelet kubeadm kubectl

问题二:初始k8s时报错

解决3:init前调用:

rm /etc/containerd/config.toml
systemctl restart containerd

  1. 安装k8s 抛出异常提示Unable to locate package kubectl ↩︎

  2. K8s安装出现GPG error ↩︎

  3. https://github.com/containerd/containerd/issues/4581 ↩︎

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐