How can I expose kubernetes services running within docker?

1/19/2016

What I want to do is run kubernetes within docker and expose the kubernetes services externally. I followed the docs on getting kubernetes running within docker. As long as I connect from the localhost, I can access my services. However, connecting from a different computer doesn't work. If I spin up a docker image directly, then I can access it. Only things running within kubernetes aren't exposed. Is this possible?

-- pgreen2
docker
kubernetes

1 Answer

2/2/2016

Ensure your nodes have externally reachable IP addresses.

Then create a service of type NodePort: https://github.com/kubernetes/kubernetes/blob/master/docs/user-guide/services.md#type-nodeport

And direct traffic to nodes at the allocated port.

-- briangrant
Source: StackOverflow