Skip to content

Instantly share code, notes, and snippets.

@Maecenas
Last active December 11, 2018 12:17
Show Gist options
  • Save Maecenas/9618a94740c950d8e15d3cc5e55a1a17 to your computer and use it in GitHub Desktop.
Save Maecenas/9618a94740c950d8e15d3cc5e55a1a17 to your computer and use it in GitHub Desktop.
How to start a single-node Kubernetes cluster with minikube on macOS under proxy

First set the local proxy to listen to address at 0.0.0.0 instead of 127.0.0.1 or localhost.

$ brew install Kubernetes-cli
$ brew cask install minikube
$ HYPERVISOR=`ifconfig en0 | grep 'inet ' | sed 's/^.*inet //g'| sed 's/ *netmask.*$//g'` && \
  PROXY="http://$HYPERVISOR:1087" && \
  minikube start \
    --docker-env HTTP_PROXY="$PROXY" \
    --docker-env HTTPS_PROXY="$PROXY" \
    --docker-env NO_PROXY="192.168.99.0/24" && \
  export no_proxy=$no_proxy,$(minikube ip) && \
  export NO_PROXY=$no_proxy,$(minikube ip);

Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment