1

I am utilizing this guide on 1 VM managed by Vagrant

I can access the containers that I start locally inside the VM just fine, but I can't seem to access them from the host machine. I have kubernetes running inside of a VM, but it isn't port fowarding out to the the host machine. I tried, the following: How to set up port forwarding from Windows host to Vagrant Linux VM to Docker containers? thanks to @analytik. I attempted the step, but it didn't seem to bear fruit. I didn't do any ssh tunneling as I am trying to get the port forwarding to work automatically.

I do have it setup for NAT and Host-Only networking. The interesting thing, even before I setup a kubernetes pod, the kubernetes master api is available inside of the VM at localhost:8080 as so:

vagrant@local:/usr/local/bin$ curl localhost:8080 { "paths": [ "/api", "/api/v1", "/healthz", "/healthz/ping", "/logs/", "/metrics", "/resetMetrics", "/swagger-ui/", "/swaggerapi/", "/ui/", "/version" ] }

But when I try to access that from the Mac I can't seem to reach it:

curl localhost:8080 curl: (52) Empty reply from server

So it is getting something, but not sure what is happening. I do have my Adapter 1 set to Nat with my various port forwarding rules, and my Adapter 2 set to Host-only Adapter.

Any thoughts? Thanks again for your help!

milk
  • 11
  • 4
  • So for my services that I expose, I am able to connect utilizing type: NodePort and a setting a nodePort. I am still unsure how to connect to the kuernetes master API, so any other thoughts would be really helpful. Thanks again! – milk Sep 16 '15 at 15:55
  • Did you ever figure this out? I'm having the exact same problem. I want to use the Kubernetes API from the outside. I saw the description of using NodePort for your own services in the docs on "Publishing a Service," but since the Kubernetes service itself isn't defined by us, how do we give it the NodePort type? Where is that defined? – Chris Westin Dec 22 '15 at 22:49

0 Answers0