Skip to content

Instantly share code, notes, and snippets.

@zloeber
Created April 2, 2020 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zloeber/528bcce2e4b45465c940a08f10551ccb to your computer and use it in GitHub Desktop.
Save zloeber/528bcce2e4b45465c940a08f10551ccb to your computer and use it in GitHub Desktop.
minikube-up.sh
#!/bin/bash
# Work around script to get minikube running on Ubuntu 19.10
# - Updates local firewall settings (ufw)
# - Whacks your local ./.kube and ./.minikube folders!
# - Runs sudo commands to get things running but does not require sudo to run thereafter
export MINIKUBE_WANTUPDATENOTIFICATION=false
export MINIKUBE_WANTREPORTERRORPROMPT=false
export MINIKUBE_HOME=$HOME
export CHANGE_MINIKUBE_NONE_USER=true
export KUBECONFIG=$HOME/.kube/config
minikubepath=$(which minikube)
sudo ufw allow in on docker0 && sudo ufw allow out on docker0
sudo ${minikubepath} start --vm-driver none
rm -rf $HOME/.minikube
rm -rf $HOME/.kube
sudo mv /root/.kube /root/.minikube $HOME
sudo chown -R $USER:$USER $HOME/.kube $HOME/.minikube
## Replace the config /root with your home path
OLDPATH='\/root'
NEWPATH=$(echo $HOME | sed 's_/_\\/_g')
sed -i -e "s/$OLDPATH/$NEWPATH/g" $HOME/.kube/config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment