Change Kubernetes API port on GKE

6/12/2017

I an spinning a single node kubernetes cluster for for each project I am working with. It works great, but the kubernetes api by default uses port 443 and I wish I could use it for ssl. I cant spend extra money on google's load balancer. Is there a way?

-- CESCO
containers
google-kubernetes-engine
kubernetes
ssl

1 Answer

6/12/2017

The Kubernetes API isn't running on a node in your cluster, and you can still use port 443 on any nodes running inside your cluster (if, for instance, you bind to a host port you'll find it unoccupied).

Instead of binding to the host port, if you use a Kubernetes service, you can bind a process inside of a container to port 443 and expose that as port 443 to your clients via the network load balancer. This has the advantage that you can bind multiple containers to 443 and expose multiple services (even on the same node) and it means that your clients aren't pinned to the IP address of the VM, which can change if the VM is repaired or upgraded or if you scale your cluster to multiple nodes in the future.

-- Robert Bailey
Source: StackOverflow