Skip to content

Instantly share code, notes, and snippets.

@ValentinFunk
Last active December 13, 2017 15:32
Show Gist options
  • Save ValentinFunk/348bc2f8b38f788c9cee520a086e1aa8 to your computer and use it in GitHub Desktop.
Save ValentinFunk/348bc2f8b38f788c9cee520a086e1aa8 to your computer and use it in GitHub Desktop.
Install Minikube
# Setup minikube
mkdir ~/kube
cd ~/kube
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl
export MINIKUBE_WANTUPDATENOTIFICATION=false
export MINIKUBE_WANTREPORTERRORPROMPT=false
export MINIKUBE_HOME=$HOME
export CHANGE_MINIKUBE_NONE_USER=true
mkdir $HOME/.kube || true
touch $HOME/.kube/config
export KUBECONFIG=$HOME/.kube/config
sudo -E ./minikube start --vm-driver=none
# this for loop waits until kubectl can access the api server that Minikube has created
for i in {1..150}; do # timeout for 5 minutes
./kubectl get po &> /dev/null
if [ $? -ne 1 ]; then
break
fi
sleep 2
done
echo "export PATH=$PATH:$HOME/kube" >> ~/.bashrc
source ~/.bashrc
# Install Helm
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment