diff --git a/scripts/archive_centos.sh b/scripts/archive_centos.sh index 724c243..5275704 100644 --- a/scripts/archive_centos.sh +++ b/scripts/archive_centos.sh @@ -1,15 +1,22 @@ #!/bin/env bash KUBE_VERSION=${1:-1.19.2} +ver=$(rpm --eval '%{centos_ver}') mkdir -p /data/{all,kubeadm,worker,kernel} cd /data ls -alhR ./* +if [ "${ver}" == "8" ]; then + rm -rf /etc/yum.repos.d/* + curl https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -o /etc/yum.repos.d/CentOS-Base.repo + yum clean all && yum makecache +fi + yum install -y epel-release yum-utils echo "[download kernel package]" -ver=$(rpm --eval '%{centos_ver}') + curl https://www.elrepo.org/elrepo-release-${ver}.el${ver}.elrepo.noarch.rpm -o /data/kernel/elrepo-release-${ver}.el${ver}.elrepo.noarch.rpm yum localinstall -y kernel/elrepo-release-${ver}.el${ver}.elrepo.noarch.rpm yum install -y --downloadonly --downloaddir=kernel --enablerepo=elrepo-kernel kernel-ml kernel-devel @@ -32,8 +39,8 @@ cat < /etc/yum.repos.d/kubernetes.repo name=Kubernetes baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-\$basearch enabled=1 -gpgcheck=1 -repo_gpgcheck=1 +gpgcheck=0 +repo_gpgcheck=0 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg exclude=kubelet kubeadm kubectl EOF