Kubernetes on GKE: bind load balancer to specific ip

10/2/2015

In gke one can define a load balancer and it will bind to the public ip of one of the node. How can I guaranty the service is always bound to the same public ip to not have to re configure external dns?

-- MrE
google-kubernetes-engine
kubernetes

2 Answers

5/19/2016

I don't think the LoadBalancer should be exposed through the IP of your pods, but instead get its own IP.

Use the Google cloud dashboard. Navigate to Networking › External IP addresses.

Find the IP of your LoadBalancer, and change it from ephemeral to static.

-- Andreas Åkre Solberg
Source: StackOverflow

10/3/2015

Try setting the ClusterIP field when defining your service. The documentation for the field says "If specified, it will be allocated to the service if it is unused or else creation of the service will fail" so this should allow you to bind your service to a specific IP address (presuming that you are allowed to use that address).

-- Robert Bailey
Source: StackOverflow