This commit is contained in:
Simon J Mudd 2021-06-09 22:46:47 -04:00 committed by GitHub
commit 0835f40e55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View File

@ -2,6 +2,11 @@
# script that runs # script that runs
# https://kubernetes.io/docs/setup/production-environment/container-runtime # https://kubernetes.io/docs/setup/production-environment/container-runtime
if [ $(id -u) != 0 ]; then
echo "Please run as root or use sudo."
exit 1
fi
yum install -y vim yum-utils device-mapper-persistent-data lvm2 yum install -y vim yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

View File

@ -2,6 +2,11 @@
# kubeadm installation instructions as on # kubeadm installation instructions as on
# https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/ # https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/
if [ $(id -u) != 0 ]; then
echo "Please run as root or use sudo."
exit 1
fi
cat <<EOF > /etc/yum.repos.d/kubernetes.repo cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes] [kubernetes]
name=Kubernetes name=Kubernetes
@ -16,9 +21,11 @@ EOF
setenforce 0 setenforce 0
sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
# disable swap (assuming that the name is /dev/centos/swap # disable swap (assuming that the name is /dev/centos*/swap)
sed -i 's/^\/dev\/mapper\/centos-swap/#\/dev\/mapper\/centos-swap/' /etc/fstab for device in $(sed -e 's/#.*//' /etc/fstab | awk '$2 == "swap" { print $1 }' | grep ^/dev/); do
swapoff /dev/mapper/centos-swap swapoff $device
sed -i -e "s,$device,#$device," /etc/fstab
done
yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes