Skip to content

Instantly share code, notes, and snippets.

@strigazi
Last active October 20, 2018 15:05
Show Gist options
  • Save strigazi/5fbc3cedbf3c7eae7e550b8d4ee221f4 to your computer and use it in GitHub Desktop.
Save strigazi/5fbc3cedbf3c7eae7e550b8d4ee221f4 to your computer and use it in GitHub Desktop.
install-docker-kubelet-upsteam-on-xenial.sh
apt-get update && \
apt-get 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-get update && \
apt-get install -y docker-ce
apt-get update && apt-get install -y apt-transport-https curl
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 https://apt.kubernetes.io/ kubernetes-xenial main
EOF
apt-get update
apt-get install -y kubelet kubeadm kubectl
apt-mark hold kubelet kubeadm kubectl
sysctl net.bridge.bridge-nf-call-iptables=1
systemctl start docker --now
systemctl start kubelet --now
IP=$(hostname -i)
kubeadm init --apiserver-advertise-address=${IP} --pod-network-cidr=10.244.0.0/16
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/bc79dd1505b0c8681ece4de4c0d86c5cd2643275/Documentation/kube-flannel.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment