Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
bootstrap single node kubernetes with minikube (no vm)
set -x
# apt -y update
# apt -y dist-upgrade
# apt -y install docker.io
which minikube || (curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && mv minikube /usr/local/bin/)
which kubectl || (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 && mv kubectl /usr/local/bin/)
which helm || (curl -Lo helm.tar.gz https://kubernetes-helm.storage.googleapis.com/helm-v2.6.1-linux-amd64.tar.gz && tar -xzf helm.tar.gz && mv linux-amd64/helm /usr/local/bin/)
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
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} # timeout for 5 minutes
do
kubectl get po &> /dev/null
if [ $? -ne 1 ]; then
break
fi
sleep 2
done
helm init
# kubectl commands are now able to interact with minikube cluster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.