fabric8io / fabric8

fabric8 is an open source microservices platform based on Docker, Kubernetes and Jenkins
http://fabric8.io/
1.76k stars 504 forks source link

go-fabric8 - windows - Cannot connect to api server #6813

Open vharcq opened 7 years ago

vharcq commented 7 years ago

Hi, Could you give me a quick hint on where I have to look for this error. I am on Windows 10 with latest version of everything on HyperV (installed through Docker Windows installation 2 days ago)

c:....fabric8\bin> gofabric8-windows-amd64.exe start --memory=2000 --cpus=2 --disk-size=10g using the executable minikube.exe running: minikube.exe start --vm-driver=hyperv --memory=2000 --cpus=2 --disk-size=10g Starting local Kubernetes cluster... Starting VM... SSH-ing files into VM... Setting up certs... Starting cluster components... Connecting to cluster... Setting up kubeconfig... Kubectl is now configured to use the cluster. Cannot connect to api server, retrying... Cannot connect to api server, retrying... etc....

....fabric8\bin> gofabric8-windows-amd64.exe status minikubeVM: Running localkube: Stopped

.....fabric8\bin> gofabric8-windows-amd64.exe validate

Could not initialise a client - is your server setting correct? Get https://[fe80::215:5dff:fe4b:105]:8443/api: dial tcp [fe80::215:5dff:fe4b:105]:8443: connectex: No connection could be made because the target machine actively refused it. ================================================================== ....\.fabric8\bin> ping fe80::215:5dff:fe4b:105 Pinging fe80::215:5dff:fe4b:105 with 32 bytes of data: Reply from fe80::215:5dff:fe4b:105: time<1ms Reply from fe80::215:5dff:fe4b:105: time<1ms etc... ================================================================== When I ssh to the minikube, I have nothing running on it netstat -an|grep 8443 ==> nothing docker ps -a ==> nothing docker images ==> nothing
daniExChay commented 7 years ago

similar situation on Win 7: Cmd: gofabric8 start --vm-driver=virtualbox minikube.exe is already available on your PATH kubectl.exe is already available on your PATH Downloading https://github.com/fabric8io/funktion-operator/releases/download/v1.0.10/funktion-operator-windows-amd64.exe ... Downloaded C:\Users\c16963a.fabric8\bin\funktion using the executable minikube.exe running: minikube.exe start --vm-driver=virtualbox --memory=6144 --cpus=1 --disk-size=50g Starting local Kubernetes cluster... Starting VM... Downloading Minikube ISO 89.26 MB / 89.26 MB [==============================================] 100.00% 0s SSH-ing files into VM... Setting up certs... Starting cluster components... Connecting to cluster... Setting up kubeconfig... Kubectl is now configured to use the cluster. Cannot connect to api server, retrying...

InBedWith commented 7 years ago

Hi similar for me on win7 entreprise. Just install fabric8 for evaluation. In VirtualBox GUI I got a running VM called minikube. when switching to VM console i got some audit logs. when asking minikube logs, i see that minikube is not able to found node info on http://127.0.0.1:8080/api/v1/nodes/minikube.

.... Apr 18 12:19:03 minikube systemd[1]: Starting Localkube... Apr 18 12:19:03 minikube localkube[3124]: name = kubeetcd Apr 18 12:19:03 minikube localkube[3124]: data dir = /var/lib/localkube/etcd Apr 18 12:19:03 minikube localkube[3124]: member dir = /var/lib/localkube/etcd/member Apr 18 12:19:03 minikube localkube[3124]: heartbeat = 100ms Apr 18 12:19:03 minikube localkube[3124]: election = 1000ms Apr 18 12:19:03 minikube localkube[3124]: snapshot count = 10000 Apr 18 12:19:03 minikube localkube[3124]: advertise client URLs = http://0.0.0.0:2379 Apr 18 12:19:03 minikube localkube[3124]: restarting member fcf2ad36debdd5bb in cluster 7f055ae3b0912328 at commit index 5331 Apr 18 12:19:03 minikube localkube[3124]: fcf2ad36debdd5bb became follower at term 2 Apr 18 12:19:03 minikube localkube[3124]: newRaft fcf2ad36debdd5bb [peers: [], term: 2, commit: 5331, applied: 0, lastindex: 5331, lastterm: 2] Apr 18 12:19:03 minikube localkube[3124]: starting server... [version: 3.0.17, cluster version: to_be_decided] Apr 18 12:19:03 minikube localkube[3124]: localkube host ip address: 10.0.2.15 Apr 18 12:19:03 minikube localkube[3124]: W0418 12:19:03.552952 3124 authentication.go:362] AnonymousAuth is not allowed with the AllowAll authorizer. Resetting AnonymousAuth to false. You should use a different authorizer Apr 18 12:19:03 minikube localkube[3124]: added member fcf2ad36debdd5bb [http://0.0.0.0:2380] to cluster 7f055ae3b0912328 Apr 18 12:19:03 minikube localkube[3124]: set the initial cluster version to 3.0 Apr 18 12:19:03 minikube localkube[3124]: enabled capabilities for version 3.0 Apr 18 12:19:03 minikube localkube[3124]: I0418 12:19:03.631980 3124 server.go:225] Using iptables Proxier. Apr 18 12:19:03 minikube localkube[3124]: W0418 12:19:03.651652 3124 server.go:469] Failed to retrieve node info: Get http://127.0.0.1:8080/api/v1/nodes/minikube: dial tcp 127.0.0.1:8080: getsockopt: connection refused Apr 18 12:19:03 minikube localkube[3124]: W0418 12:19:03.651818 3124 proxier.go:304] invalid nodeIP, initializing kube-proxy with 127.0.0.1 as nodeIP Apr 18 12:19:03 minikube localkube[3124]: W0418 12:19:03.651894 3124 proxier.go:309] clusterCIDR not specified, unable to distinguish between internal and external traffic Apr 18 12:19:03 minikube localkube[3124]: I0418 12:19:03.651969 3124 server.go:249] Tearing down userspace rules. Apr 18 12:19:03 minikube localkube[3124]: E0418 12:19:03.693632 3124 reflector.go:201] k8s.io/minikube/vendor/k8s.io/kubernetes/pkg/proxy/config/api.go:49: Failed to list api.Endpoints: Get http://127.0.0.1:8080/api/v1/endpoints?resourceVersion=0: dial tcp 127.0.0.1:8080: getsockopt: connection refused Apr 18 12:19:03 minikube localkube[3124]: E0418 12:19:03.693806 3124 reflector.go:201] k8s.io/minikube/vendor/k8s.io/kubernetes/pkg/proxy/config/api.go:46: Failed to list api.Service: Get http://127.0.0.1:8080/api/v1/services?resourceVersion=0: dial tcp 127.0.0.1:8080: getsockopt: connection refused Apr 18 12:19:03 minikube localkube[3124]: W0418 12:19:03.748376 3124 storage_codec.go:52] storage type "etcd2" does not support media type "application/vnd.kubernetes.protobuf", using "application/json" Apr 18 12:19:03 minikube localkube[3124]: W0418 12:19:03.749868 3124 storage_codec.go:52] storage type "etcd2" does not support media type "application/vnd.kubernetes.protobuf", using "application/json" Apr 18 12:19:03 minikube localkube[3124]: W0418 12:19:03.750031 3124 storage_codec.go:52] storage type "etcd2" does not support media type "application/vnd.kubernetes.protobuf", using "application/json" Apr 18 12:19:03 minikube localkube[3124]: W0418 12:19:03.750257 3124 storage_codec.go:52] storage type "etcd2" does not support media type "application/vnd.kubernetes.protobuf", using "application/json" Apr 18 12:19:03 minikube localkube[3124]: W0418 12:19:03.750483 3124 storage_codec.go:52] storage type "etcd2" does not support media type "application/vnd.kubernetes.protobuf", using "application/json"

.....

C:\Users\InBedWith.fabric8\bin>gofabric8 start --vm-driver=virtualbox Downloading https://storage.googleapis.com/minikube/releases/v0.18.0/minikube-windows-amd64.exe... Downloaded C:\Users\InBedWith.fabric8\bin\minikube.exe Downloading https://storage.googleapis.com/kubernetes-release/release/v1.6.1/bin/windows/amd64/kubectl.exe... Downloaded C:\Users\InBedWith.fabric8\bin\kubectl.exe Downloading https://github.com/fabric8io/funktion-operator/releases/download/v1.0.10/funktion-operator-windows-amd64.exe... Downloaded C:\Users\InBedWith.fabric8\bin\funktion using the executable minikube.exe running: minikube.exe start --vm-driver=virtualbox --memory=6144 --cpus=1 --disk-size=50g Starting local Kubernetes cluster... Starting VM... Downloading Minikube ISO 89.51 MB / 89.51 MB [==============================================] 100.00% 0s SSH-ing files into VM... Setting up certs... Starting cluster components... Connecting to cluster... Setting up kubeconfig... Kubectl is now configured to use the cluster. Cannot connect to api server, retrying... Cannot connect to api server, retrying... Cannot connect to api server, retrying... Cannot connect to api server, retrying... Cannot connect to api server, retrying... Cannot connect to api server, retrying... Cannot connect to api server, retrying... Cannot connect to api server, retrying... Cannot connect to api server, retrying... Cannot connect to api server, retrying... Cannot connect to api server, retrying... Cannot connect to api server, retrying... Unable to connect to minikube.exe timed out

daniExChay commented 7 years ago

MY WORKAROUND!!! My Cisco AnyConnect VPN was killing my local Kubernetes cluster communication. Turning VPN off allowed me to follow the instructions here to get local fabric8 going: https://blog.fabric8.io/a-busy-java-developers-guide-to-developing-microservices-on-kubernetes-and-docker-98b7b9816fdf One Caveat: the fabric8 service is not exposed; I add "nodePort : 31000" and change to "type : NodePort"

It would be nice to have my kubernetes and my VPN too!

InBedWith commented 7 years ago

Hi all,

I have fixed the issue. It is a proxy issue. I have to setup no_proxy with the VB ip. you can run minikube ip to get the ip then set no_proxy=localhost,127.0.0.1,[VM_IP]

jimternet commented 7 years ago

Thank you @InBedWith ! been struggling with this for a bit