打开
vim /etc/yum.repos.d/k8s.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
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
刷新缓存
yum clean all
yum list
下载docker
yum -y install docker-ce
配置开机自启动&启动
systemctl enable docker-ce --now
查看docker基础信息
docker info
下载kubernetes
yum -y install kubelet-1.22.2-0 kubeadm-1.22.2-0 kubectl-1.22.2-0 --disableexcludes=kubernetes
下载完毕后通过kubeadm安装kubernetes集群
kubeadm init --image-repository regitry.aliyuncs.com/google_containers --kubernetes-version=v1.20.0 --pod-network-cidr=10.244.0.0/16