11

I'm new to Kubernetes. With the help of Kubernetes documentation , I installed minikube(v0.24.1) and kubectl in my Windows machine. VirtualBox(Version 5.1.18) is also installed in my machine.

Before starting the minikube, i have executed set HTTP_PROXY=xx.xx.xx:8080 and set NO_PROXY=localhost,127.0.0.0/8,192.0.0.0/8 in Windows command prompt

Started minikube by passing Proxy Details :

C:\minikube>minikube start --memory 4096  --vm-driver=virtualbox --docker-env http_proxy=xx.xx.xx:8080  --docker-env https_proxy=xx.xx.xx:8080 --docker-env no_proxy=localhost,127.0.0.0/8,192.0.0.0/8 --cache-images=false
Starting local Kubernetes v1.9.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.
Loading cached images from config file.

Error from Kubectl :

C:\minikube>kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.0", GitCommit:"925c127ec6b946659ad0fd596fa959be43f0cc05", GitTreeState:"clean", BuildDate:"2017-12-15T21:07:38Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"windows/amd64"}
Unable to connect to the server: dial tcp 192.168.99.100:8443: connectex: An attempt was made to access a socket in a way forbidden by its access permissions.

Minikube Logs:

Feb 01 08:48:35 minikube localkube[2941]: E0201 08:48:35.223594    2941 proxier.go:1701] Failed to delete stale service IP 10.96.0.10 connections, error: error deleting connection tracking
 file not found in $PATH
Feb 01 08:48:38 minikube localkube[2941]: I0201 08:48:38.738404    2941 node_controller.go:857] Controller detected that some Nodes are Ready. Exiting master disruption mode.
Feb 01 08:48:45 minikube localkube[2941]: W0201 08:48:45.765543    2941 conversion.go:110] Could not get instant cpu stats: different number of cpus
Feb 01 08:48:55 minikube localkube[2941]: W0201 08:48:55.776172    2941 conversion.go:110] Could not get instant cpu stats: different number of cpus
Feb 01 08:49:24 minikube localkube[2941]: E0201 08:49:24.338731    2941 healthcheck.go:317] Failed to start node healthz on 0: listen tcp: address 0: missing port in address
Feb 01 08:50:24 minikube localkube[2941]: E0201 08:50:24.341890    2941 healthcheck.go:317] Failed to start node healthz on 0: listen tcp: address 0: missing port in address
Feb 01 08:51:24 minikube localkube[2941]: E0201 08:51:24.342845    2941 healthcheck.go:317] Failed to start node healthz on 0: listen tcp: address 0: missing port in address
Feb 01 08:52:24 minikube localkube[2941]: E0201 08:52:24.344497    2941 healthcheck.go:317] Failed to start node healthz on 0: listen tcp: address 0: missing port in address
Feb 01 08:53:24 minikube localkube[2941]: E0201 08:53:24.349095    2941 healthcheck.go:317] Failed to start node healthz on 0: listen tcp: address 0: missing port in address
Feb 01 08:54:24 minikube localkube[2941]: E0201 08:54:24.351143    2941 healthcheck.go:317] Failed to start node healthz on 0: listen tcp: address 0: missing port in address

How to fix this issue?

Steffi Keran Rani J
  • 3,667
  • 4
  • 34
  • 56
user2439278
  • 1,222
  • 7
  • 41
  • 75
  • Are you behind a proxy? – lvthillo Jan 24 '18 at 09:22
  • Yes. My windows machine is behind the proxy. – user2439278 Jan 24 '18 at 09:23
  • If by "behind a proxy", you mean that, *before* installing Kubernetes and minikube, you already had `HTTP(S)_PROXY` environment variable in place, then you might consider setting a `NO_PROXY` environment variable in order to *not* use the proxy when accessing to your minikube IPs. – VonC Jan 28 '18 at 19:41
  • I have started the minikube by following command `minikube start --docker-env http_proxy=http://xx.xx.xx:8080 \ --docker-env https_proxy=http://xx.xx.xx:8080 --docker-env no_proxy=192.168.99.0/24` . But no luck :( – user2439278 Jan 29 '18 at 10:33
  • When i execute `set NO_PROXY=192.168.0.0/16` in command prompt and start the minikube , I'm getting error message `Unable to connect to the server: dial tcp 192.168.99.102:8443: connectex: An attempt was made to access a socket in a way forbidden by its access permissions.` when i tried to execute `kubectl get pod` – user2439278 Jan 30 '18 at 14:12

1 Answers1

2

As @ivthillo already was pointing out, the issue may occur because you are behind a proxy. In this link they explain solutions to configure minikube when you are behind a proxy: https://github.com/kubernetes/minikube/issues/530#issuecomment-250801735

Try starting minikube like this:

minikube start --docker-env HTTP_PROXY=http://$YOURPROXY:PORT \ --docker-env HTTPS_PROXY=https://$YOURPROXY:PORT

This should configure docker to use your proxy.

Here they also propose other solutions: https://github.com/kubernetes/minikube/issues/530#issuecomment-347718692

Javier Salmeron
  • 8,365
  • 2
  • 28
  • 23
  • I have started the minikube given in above comment. when i execute `kubectl get pod` command, got an error message as `Unable to connect to the server: net/http: TLS handshake timeout` – user2439278 Jan 24 '18 at 11:49
  • Can you do minikube ssh and try to curl google.com for example? It looks like it is missing CA authorities – Javier Salmeron Jan 24 '18 at 11:55
  • when i logged in to minikube server using `minikube ssh` and execute `curl google.com`, got an response as `curl: (7) Failed to connect to google.com port 80: Connection timed out`. How to set proxy inside minikube ssh – user2439278 Jan 24 '18 at 12:30
  • The timeout again, as if the proxy is not taking effect. Could you execute env to confirm that the variables are set (inside the minikube machine) – Javier Salmeron Jan 24 '18 at 14:24
  • output of `env` command inside minikube machine : `SSH_CONNECTION=10.0.2.2 52799 10.0.2.15 22 EDITOR=/bin/vi USER=docker PAGER=/bin/more PWD=/home/docker HOME=/home/docker SSH_CLIENT=10.0.2.2 52799 22 SSH_TTY=/dev/pts/0 MAIL=/var/mail/docker TERM=xterm SHELL=/bin/bash SHLVL=1 LOGNAME=docker PATH=/bin:/sbin:/usr/bin:/usr/sbin PS1=$ _=/bin/env` – user2439278 Jan 24 '18 at 14:42
  • Can you try the command again but before execute this export HTTP_PROXY=$YOURPROXY:PORT and export HTTPS_PROXY=$YOURPROXY:PORT. This will help us see if the minikube machine works with the proxy – Javier Salmeron Jan 28 '18 at 14:24
  • I have started the minikube by following command `minikube start --docker-env http_proxy=http://xx.xx.xx:8080 \ --docker-env https_proxy=http://xx.xx.xx:8080 --docker-env no_proxy=192.168.99.0/24` . Do I need execute command export HTTPS_PROXY inside minikube ssh – user2439278 Jan 29 '18 at 10:33
  • Yes, that's what I wanted you to try. just to check the connectivity – Javier Salmeron Jan 29 '18 at 11:29
  • I can execute export HTTPS_PROXY command inside minikube ssh and `curl google.com` works. But when i exit the minikube ssh and again do minikube ssh , curl doesnt work. – user2439278 Jan 29 '18 at 11:33
  • Could you confirm you are using the latest minikube version? – Javier Salmeron Jan 29 '18 at 13:35
  • Yes. The minikube version is 0.24.1 – user2439278 Jan 29 '18 at 13:42
  • When i execute `set NO_PROXY=192.168.0.0/16` in command prompt and start the minikube , I'm getting error message `Unable to connect to the server: dial tcp 192.168.99.102:8443: connectex: An attempt was made to access a socket in a way forbidden by its access permissions.` when i tried to execute `kubectl get pod` – user2439278 Jan 30 '18 at 14:13
  • I have also added the proxy settings to /etc/profile inside boot2docker vm. But when I executed minikube stop and start command, it creates a new VM.The proxy settings not found in the VM – user2439278 Feb 05 '18 at 10:48