Skip to content

Commit

Permalink
fix: centos error.
Browse files Browse the repository at this point in the history
  • Loading branch information
lework committed Apr 1, 2022
1 parent 2c04af6 commit 35d3571
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions scripts/archive_centos.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -32,8 +39,8 @@ cat <<EOF > /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
Expand Down

0 comments on commit 35d3571

Please sign in to comment.