国内要通过正常网络访问安装kubernetes的组件太难了,使用镜像源代替之..

aliyun

查看帮助

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13

cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
setenforce 0
yum install -y kubelet kubeadm kubectl
systemctl enable kubelet && systemctl start kubelet

腾讯镜像

官网没有使用帮助,根据aliyun的照猫画虎,切换源之后,最好执行一次yum clean all以清除缓存。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.cloud.tencent.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://mirrors.cloud.tencent.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.cloud.tencent.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF

setenforce 0
yum install -y kubelet kubeadm kubectl
systemctl enable kubelet && systemctl start kubelet