Skip to content

Instantly share code, notes, and snippets.

@robertBrem
Last active May 28, 2018
Embed
What would you like to do?
sudo su -
apt-get update
curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh
cat << EOF > /etc/docker/daemon.json
{
"exec-opts": ["native.cgroupdriver=systemd"]
}
EOF
service docker restart
apt-get update && apt-get install -y apt-transport-https
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
sed -i "s/KUBELET_EXTRA_ARGS/KUBELET_EXTRA_ARGS --cgroup-driver=systemd/" /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
systemctl daemon-reload
service kubelet restart
export KUBECONFIG=/etc/kubernetes/admin.conf
# NUR MASTER!!!!
kubeadm init --apiserver-advertise-address=XX.XX.XX.XX
export kubever=$(kubectl version | base64 | tr -d '\n')
kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$kubever"
kubectl taint nodes --all node-role.kubernetes.io/master-
# LOCAL
export KUBE_LATEST_VERSION="v1.9.2"
curl -LO https://storage.googleapis.com/kubernetes-release/release/${KUBE_LATEST_VERSION}/bin/linux/amd64/kubectl
chmod +x ./kubectl
mv ./kubectl /usr/local/bin/kubectl
export HELM_LATEST_VERSION="v2.8.0"
curl -LO https://storage.googleapis.com/kubernetes-helm/helm-${HELM_LATEST_VERSION}-linux-amd64.tar.gz
tar -xvf helm-${HELM_LATEST_VERSION}-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin
kubectl create clusterrolebinding tiller-cluster-admin \
--clusterrole=cluster-admin \
--serviceaccount=kube-system:default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment