Skip to content

Instantly share code, notes, and snippets.

@ceizner
Last active February 25, 2020 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ceizner/f3c595d807323be37376ca9507c87d5e to your computer and use it in GitHub Desktop.
Save ceizner/f3c595d807323be37376ca9507c87d5e to your computer and use it in GitHub Desktop.
Install all-in-one Docker and k8s on Ubuntu
#!/bin/bash
# install Docker
curl -s https://get.docker.com | bash
# Install kubeadm
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
#pull images
kubeadm config images pull
# Install one node witl CDR for calico
kubeadm init --pod-network-cidr=192.168.1.0/16
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
# Install network (calico)
kubectl apply -f https://docs.projectcalico.org/v3.8/manifests/calico.yaml
# Control plane node isolation
kubectl taint nodes --all node-role.kubernetes.io/master-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment