docker 安装
略
kubectl安装
加入k8s的仓库源
cat > /etc/yum.repos.d/k8s.repo << EOF
[kubernetes]
name=kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=0
repo_gpgcheck=0
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
查看可安装列表
这里坑到我了,sort排序是按版本号的数字每一位来排序。我安装了老版本的,导致后面安装了不可以用
yum list kubectl --showduplicates | sort -r
安装
yum install -y kubectl-1.9.8-0 (老版本)
改为
yum install -y kubectl-1.21.1
验证安装
[root@kind centos]# kubectl version
Client Version: version.Info{
Major:"1", Minor:"9", GitVersion:"v1.9.8", GitCommit:"c138b85178156011dc934c2c9f4837476876fb07", GitTreeState:"clean", BuildDate:"2018-05-21T19:01:12Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?
安装kind
O