Last active
March 28, 2024 16:08
-
-
Save joshy91/01316c6fff217263777ecd947395b30e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install kubernetes on CentOS | |
#run as root | |
#kubernetes will refuse to run on CentOS if swapoff is on | |
#line 1 & 2 ensure swapoff doesn’t interfere with k8 | |
swapoff -a | |
sed -i '/ swap swap /s/^/#/' /etc/fstab | |
yum -y update | |
yum -y install docker | |
systemctl enable docker && systemctl start docker | |
echo “[kubernetes] | |
name=Kubernetes | |
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 | |
enabled=1 | |
gpgcheck=1 | |
repo_gpgcheck=1 | |
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg” >> /etc/yum.repos.d/kubernetes.repo | |
#Ensure that SELINUX doesn’t prevent docker and kubernetes from functioning | |
setenforce 0 | |
sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config | |
yum install -y kubelet kubeadm kubectl | |
systemctl enable kubelet && systemctl start kubectl | |
echo “net.bridge.bridge-nf-call-ip6tables = 1 | |
net.bridge.bridge-nf-call-iptables = 1” >> /etc/sysctl.d/k8s.conf | |
sysctl --system |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment