Create a gist now

Instantly share code, notes, and snippets.

@kiloreux /ovh.sh Secret
Created Jan 6, 2018

Embed
What would you like to do?
#!/usr/bin/env bash
set -o pipefail
set -o errexit
set -o nounset
# set -o xtrace
sudo true
#Install docker
sudo apt-get -y install linux-image-extra-$(uname -r)
wget -qO- https://get.docker.com/ | sh
# Add user to docker group
sudo usermod -aG docker $USER
# Install Kubernetes
sudo apt-get update && sudo apt-get install -y apt-transport-https
sudo curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main"| sudo tee -a /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
#Initialize kubeadm
sudo kubeadm init --pod-network-cidr=10.244.0.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 flannel to handle networking between pods
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
# Enable pods to run on master node
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