Skip to content

Instantly share code, notes, and snippets.

@rvanbutselaar
Last active January 23, 2020 10:26
Show Gist options
  • Save rvanbutselaar/1cfe838297ea5138a58c55ab44fda800 to your computer and use it in GitHub Desktop.
Save rvanbutselaar/1cfe838297ea5138a58c55ab44fda800 to your computer and use it in GitHub Desktop.
Requirements for Kubernetes kubeadm init
yum install -y docker
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[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
EOF
cat <<EOF > /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system
# Set SELinux in permissive mode (effectively disabling it)
setenforce 0
sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
systemctl enable --now kubelet
systemctl enable --now docker
swapoff -a
sed -i '/swapfile/d' /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment