安装kubernetes的时候,需要安装kubelet, kubeadm等包,但k8s官网给的yum源是packages.cloud.google.com,国内访问不了,此时我们可以使用阿里云的yum仓库镜像。

阿里云上没有附Help说明连接,简单摸索了下,如下设置可用(centos)。注意不要开启check。

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

本文转自 cs312779641 51CTO博客,原文链接:http://blog.51cto.com/chenhao6/1979639