Skip to content

Instantly share code, notes, and snippets.

@ElykDeer
Created August 16, 2018 03:48
Show Gist options
  • Save ElykDeer/2d17c7a5f25762102bb3324d13bc7137 to your computer and use it in GitHub Desktop.
Save ElykDeer/2d17c7a5f25762102bb3324d13bc7137 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
# No swap for kube!!
swapoff -a
sed -i '/ swap / s/^/#/' /etc/fstab
rm /swap.img
# We need updates
apt update && apt upgrade -y
# Docker
apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt update && apt install docker-ce
# Kube
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
apt-get update
apt-get install -y kubelet kubeadm kubectl
apt-mark hold kubelet kubeadm kubectl
echo "Now join to master!!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment