Skip to content

Instantly share code, notes, and snippets.

@sfxworks
Last active October 11, 2020 11:10
Show Gist options
  • Save sfxworks/d41f9878248ee66ab99df540c8c64366 to your computer and use it in GitHub Desktop.
Save sfxworks/d41f9878248ee66ab99df540c8c64366 to your computer and use it in GitHub Desktop.
containerd-kubectl-ubuntu.sh
#wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.8-rc3/amd64/linux-headers-5.8.0-050800_5.8.0-050800.202006282330_all.deb
#wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.8-rc3/amd64/linux-headers-5.8.0-050800-generic_5.8.0-050800.202006282330_amd64.deb
#wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.8-rc3/amd64/linux-image-unsigned-5.8.0-050800-generic_5.8.0-050800.202006282330_amd64.deb
#wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.8-rc3/amd64/linux-modules-5.8.0-050800-generic_5.8.0-050800.202006282330_amd64.deb
apt-get update -y && apt-get upgrade -y
cat <<EOF | tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sudo sysctl --system
cat <<EOF | tee /etc/default/kubelet
KUBELET_EXTRA_ARGS="--fail-swap-on=false --cgroup-driver=systemd --cpu-cfs-quota=false"
EOF
cat <<EOF | tee /etc/resolv.conf
nameserver 1.1.1.3
nameserver 1.0.0.3
EOF
apt-get install -y apt-transport-https curl containerd ipset ipvsadm
cat <<EOF | tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
cat <<EOF | tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
apt-get update -y
apt-get install -y kubelet kubeadm kubectl avahi-daemon
apt-mark hold kubelet kubeadm kubectl
modprobe br_netfilter
echo "br_netfilter" > /etc/modules
echo '1' > /proc/sys/net/ipv4/ip_forward
echo 'net.ipv4.ip_forward = 1' >> /etc/sysctl.conf
swapoff -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment