前言:
现在我们对“yum安装kubernetes18”大约比较关切,看官们都想要剖析一些“yum安装kubernetes18”的相关文章。那么小编同时在网上搜集了一些对于“yum安装kubernetes18””的相关文章,希望兄弟们能喜欢,兄弟们一起来了解一下吧!1、制作本地yum源
# 下载所需工具依赖包
yum install --downloadonly --downloaddir=/opt/repo ntpdate wget httpd createrepo vim telnet netstat lrzsz chroot unzip git net-tools
# 配置国内yum源
yum clean all
yum makecache
yum install -y wget createrepo
wget -O /etc/yum.repos.d/docker-ce.repo
yum install --downloadonly --downloaddir=/opt/repo docker-ce
# 配置国内kubernetes源
cat > /etc/yum.repos.d/kubernetes.repo << EOF
[kubernetes]
name=Kubernetes
baseurl=
enabled=1
gpgcheck=0
repo_gpgcheck=0
gpgkey=
EOF
# 下载好kubelet-1.23.0 kubeadm-1.23.0 kubectl-1.23.0所需要的依赖包
yum install --downloadonly --downloaddir=/opt/repo kubelet-1.23.0 kubeadm-1.23.0 kubectl-1.23.0
wget --no-check-certificate
wget
# 将下载软件包的目录制作为yum源
createrepo /opt/repo/
createrepo --update /opt/repo
cd /opt/repo
yum install -y httpd
systemctl start httpd && systemctl enable httpd
ln -s /opt/repo /var/www/html/
cd ~
2、k8s集群节点配置yum源
cd /etc/yum.repos.d/
mkdir backup
mv CentOS-* backup/
# 在每个节点创建离线环境repo源
cat > /etc/yum.repos.d/local.repo << EOF
[local]
name=local
baseurl=
enabled=1
gpgcheck=0
EOF
yum clean all && yum makecache
# 测试
yum -y install docker-ce