Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Exposing Ports Outside the Kubernetes Cluster

DZone's Guide to

Exposing Ports Outside the Kubernetes Cluster

Learn the fast and consistent way to get around a potentially confusing setup of exporting cluster ports.

· Cloud Zone
Free Resource

Download this eBook outlining the critical components of success for SaaS companies - and the new rules you need to play by.  Brought to you in partnership with NuoDB.

So there is a ton of documentation out there on Kubernetes and how to expose ports outside the cluster. Perhaps I was having an issues interpreting the docs but I struggled for a long time with this. No matter what I did I found that I could get to the pod as long as I was inside the cluster (vagrant ssh minion-1) but could not get it from my browser.

After a lot of spinning I finally got this figured out; this article is to help others replicate it. The key was using nodePort value in the configuration, along with the node IP address, to reach into the pod from outside the cluster. This means setting ‘type: NodePort’ in your configuration then using the nodePort assigned with the IP address of the node to access: ‘http://10.245.1.3:30892/’.

Here's an image to help clarify:

Screen Shot 2015-08-27 at 7.53.44 PM kube-nodeport

 

Learn how moving from a traditional, on-premises delivery model to a cloud-based, software-as-a-service (SaaS) strategy is a high-stakes, bet-the-company game for independent software vendors. Brought to you in partnership with NuoDB.

Topics:
kubernetes ,clustering ,cloud

Published at DZone with permission of Jason McDonald, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}