Learn how to use Kubernetes External IP service type

Mohamad Fadhil
The Startup
Published in
7 min readDec 21, 2019

--

This article originally published here

When building a bare metal Kubernetes cluster, you might face a common problem as I do. You don’t know how to expose your Kubernetes service to the Internet other than using NodePort. If you are using the NodePort service type, it will assign a high port number, and you have to allow your firewall rule to connect to those ports. That is not good for your infrastructure, especially when you’re exposing the server to the outside Internet. Well, there is another neat way to expose your Kubernetes service to the world, and you can use its original port number. For example, you can expose MySQL service that resides in your Kubernetes cluster to the outside world on port 3306 rather than port 32767. The answer is using Kubernetes External IP service type.

Personally, I find that this topic not widely discussed among the Kubernetes community, probably because many are using cloud providers’ Load Balancer or use Metal LB for on-prem deployments.

What is External IP Service

From official Kubernetes documentation, this is how External IP is described

If there are external IPs that route to one or more cluster

--

--