Skip to content

Instantly share code, notes, and snippets.

@alexcmd
Last active December 23, 2019 14:00
Show Gist options
  • Save alexcmd/cc36b86fb632523f8189d9b44a109d64 to your computer and use it in GitHub Desktop.
Save alexcmd/cc36b86fb632523f8189d9b44a109d64 to your computer and use it in GitHub Desktop.
echo "Remove old version of Docker"
sudo apt -y remove docker docker-engine docker.io containerd runc
echo "Install PPA"
sudo apt install -y apt-transport-https curl
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
sudo apt update
sudo apt -y upgrade
echo "Install sofware"
sudo apt install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
sudo apt install -y docker-ce docker-ce-cli containerd.io
sudo apt install -y kubelet kubeadm kubectl
echo "Setup"
sudo swapoff -a
sudo sed -i '/[\t| ]swap[\t| ]/ s/^\(.*\)$/#\1/g' /etc/fstab
echo "net.ipv4.ip_forward=1" | sudo tee -a /etc/sysctl.conf
echo "net.bridge.bridge-nf-call-iptables=1" | sudo tee -a /etc/sysctl.conf
sudo sysctl --system
echo br_netfilter | sudo tee -a /etc/modules
sudo systemctl restart systemd-modules-load.service
echo " export DOCKER_OPTS=\"--exec-opt native.cgroupdriver=systemd\"" | sudo tee -a /etc/default/docker
sudo systemctl daemon-reload
sudo systemctl enable docker
sudo systemctl restart docker
sudo systemctl restart kubelet
sudo groupadd docker
sudo usermod -aG docker $USER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment