..

centos 使用 aliyun 源安装 k8s 命令行工具

国内网络安装 k8s 命令行工具特别不方便, 我找到了阿里云的 yum 源来加速安装.

  1. 添加 yum 源代
vi /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
  1. 安装 k8s 命令行工具
yum install -y kubelet kubeadm kubectl
  1. 检查安装结果
[vagrant@localhost ~]$ kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:11:31Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?
[vagrant@localhost ~]$

Ok , 安装成功了.

2020-06-09日更新

这个可以找到历史版本的 k8s 组件

https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/Packages/