GithubHelp home page GithubHelp logo

Comments (6)

mwarkentin avatar mwarkentin commented on July 29, 2024

I assume this is related to the issue I was having - I spun up the single-node Vagrant instance, and went through the whole multi-tier app configuration, without much issue. However I was unable to access the guestbook app in my browser, and I assume it's related to Vagrant port forwarding. I tried a few different changes to the Vagrantfile networking, but am unable so far to be able to access it.

Some documentation (or perhaps there's some way to handle this automatically) would be helpful. Here's my kubernetes services, if someone could provide a pointer on how I need to update vagrant:

mwarkentin@Michaels-iMac kubernetes (master) $ kubectl get services
NAME           LABELS                                    SELECTOR                IP(S)       PORT(S)
guestbook      app=guestbook                             app=guestbook           10.3.0.96   3000/TCP
kubernetes     component=apiserver,provider=kubernetes   <none>                  10.3.0.1    443/TCP
redis-master   app=redis,role=master                     app=redis,role=master   10.3.0.57   6379/TCP
redis-slave    app=redis,role=slave                      app=redis,role=slave    10.3.0.66   6379/TCP

I tried the following changes, but was still unable to view it on http://localhost:3000:

  • config.vm.network "forwarded_port", guest: 3000, host: 3000
  • config.vm.network "forwarded_port", guest_ip: "10.3.0.96", guest: 3000, host: 3000

from coreos-kubernetes.

aaronlevy avatar aaronlevy commented on July 29, 2024

You should be able to reach the guestbook via the service NodePort on your vagrant node (no additional port forwarding needed).

The example should have set up a service with a NodePort, which you should be able to see with:

$ kubectl describe service guestbook
Name:                   guestbook
Namespace:              default
Labels:                 app=guestbook
Selector:               app=guestbook
Type:                   LoadBalancer
IP:                     10.3.0.159
Port:                   <unnamed>       3000/TCP
NodePort:               <unnamed>       30635/TCP
Endpoints:              10.2.10.3:3000,10.2.10.4:3000,10.2.10.5:3000
Session Affinity:       None
No events.

The NodePort will be randomly assigned from the range 30000-32676, so in your case the nodeport will likely be different.

Then from your local machine's browser, you should be able to see the guestbook via http://172.17.4.99:<nodeport>

from coreos-kubernetes.

aaronlevy avatar aaronlevy commented on July 29, 2024

Also, for more detail on NodePorts & external services: http://kubernetes.io/v1.0/docs/user-guide/services.html#external-services

from coreos-kubernetes.

mwarkentin avatar mwarkentin commented on July 29, 2024

@aaronlevy Thank you, I'll give that a shot!

from coreos-kubernetes.

mwarkentin avatar mwarkentin commented on July 29, 2024

That worked! Might be helpful to have something about that in the docs. 😄

from coreos-kubernetes.

aaronlevy avatar aaronlevy commented on July 29, 2024

Glad it worked. I just went through the upstream guestbook docs, and it does seem a little confusing because there is no mention of the nodeport (which is necessary for platforms that do not support cloud-provider loadbalancers). I'll open a ticket to add some documentation around this.

from coreos-kubernetes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.