Ubuntu22.04 安装 Kubernetes


一、安装docker.io

sudo apt install docker.io

二、安装k8s

1、安装问题1

Err:2 https://packages.cloud.google.com/apt kubernetes-xenial InRelease
  Could not connect to packages.cloud.google.com:443 (172.217.160.78), connection timed out

解决:

https://packages.cloud.google.com/apt/doc/apt-key.gpg

 

上面链接手动下载,命令为kubernetes-archive-keyring.gpg

/usr/share/keyrings/kubernetes-archive-keyring.gpg

2、安装源问题

Err:5 https://packages.cloud.google.com/apt kubernetes-xenial InRelease
  Could not connect to packages.cloud.google.com:443 (172.217.160.110), connection timed out
Fetched 99.8 kB in 39s (2,578 B/s)
Reading package lists... Done
W: Failed to fetch http://apt.kubernetes.io/dists/kubernetes-xenial/InRelease  Could not connect to packages.cloud.google.com:443 (172.217.160.110), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.
root@ubuntu00:/etc/apt# ls

替换安装源

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

改为

echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] http://mirrors.ustc.edu.cn/kubernetes/apt kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list

 

3、安装

 sudo apt install kubeadm kubelet kubectl kubernetes-cni

 

原创文章,作者:jamestackk,如若转载,请注明出处:https://blog.ytso.com/268148.html

(0)
上一篇 2022年6月19日
下一篇 2022年6月19日

相关推荐

发表回复

登录后才能评论