Last active
July 18, 2017 20:41
-
-
Save sergeycherepanov/4654b0ab0ed3968f0b375cae3528a333 to your computer and use it in GitHub Desktop.
kubernetes on ubuntu xenial (16.04)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install tools | |
apt-get update && apt-get install -y apt-transport-https curl | |
# Setup kubernetes apt repository | |
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - | |
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | tee /etc/apt/sources.list.d/kubernetes.list | |
# Install kubernetes | |
apt-get update | |
apt-get install -y docker.io kubelet kubeadm | |
# Initialize new kubernetes cluster | |
kubeadm init --pod-network-cidr=10.244.0.0/16 | |
# Configure kubectl for current user | |
mkdir -p $HOME/.kube | |
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config | |
sudo chown $(id -u):$(id -g) $HOME/.kube/config | |
# Configure kubernetes nodes | |
kubectl taint nodes --all node-role.kubernetes.io/master- | |
# Setup Flannel network | |
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel-rbac.yml | |
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment