Kubernetes - Vagrant and NodePort

5/16/2016

I'm trying to run the kubernetes guestbook app on Vagrant on my local Mac OS X machine.

I have all the nodes (master and node-1) running, by running the following:

./kubectl.sh create -f ../examples/guestbook/all-in-one/guestbook-all-in-one.yaml

As I'm running locally, I also changed the about yaml file, to use NodePort instead of LoadBalancer

Running the following:

./kubectl.sh describe service frontend returns the following:

Name:           frontend
Labels:         app=guestbook,tier=frontend
Selector:       app=guestbook,tier=frontend
Type:           NodePort
IP:         10.247.127.146
Port:           <unnamed>   80/TCP
NodePort:       <unnamed>   31030/TCP
Endpoints:      10.246.9.12:80,10.246.9.13:80,10.246.9.7:80
Session Affinity:   None
No events.

If I try: http://10.247.127.146:31030 It doesn't conenct to the guestbook app.

Is there anything I'm doing wrong?

Thanks

-- user1970557
kubernetes
vagrant

1 Answer

5/17/2016

nodePort is the port available on every kubernetes node.

You need to find the IP address of your kubernetes node, and then http://<nodeIP>:31030 should work.

-- Andy Smith
Source: StackOverflow