docker已默认安装成功。
1.配置阿里云kubeadm的yum源:
cat /etc/yum.repos.d/kubernets.repo
[kubernetes]
name=Kubernetes
baseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=0
2.开始安装:
yum -y install kubelet kubeadm kubectl --disableexcludes=kubernetes
如想制定版本安装,以1.14版本为例:
yum -y install kubelet-1.14.2 kubeadm-1.14.2 kubectl--1.14.2 --disableexcludes=kubernetes
3.如安装时,出现如下两种错误:
错误一:
Error: Package: kubelet-1.19.2-0.x86_64 (kubernetes)
Requires: conntrack
错误二:
Error: Package: kubelet-1.14.2-0.x86_64 (kubernetes)
Requires: kubernetes-cni = 0.7.5
解决方法:下载yum源,安装依赖包
cd /etc/yum.repos.d/
wget http://mirrors.aliyun.com/repo/epel-7.repo
wget http://mirrors.aliyun.com/repo/Centos-7.repo
yum install epel-release
yum install conntrack-tools
来源:oschina
链接:https://my.oschina.net/u/4399604/blog/4777280