Private IP address advertised in public DNS records for federated services with Kubernetes 1.3 and an OpenStack cloud provider

9/16/2016

I run into the following problem while testing the new cluster federation features of Kubernetes 1.3.6 with k8s clusters configured with an OpenStack cloud provider. When I create a federated service, k8s creates a DNS record for every LoadBalancer Ingress IP of the underlying services created on each cluster. When creating a service in loadbalancer mode with OpenStack, two IP addresses are returned:

  • the vip associated with the OpenStack loadbalancer
  • the floating IP attached to this vip

The floating IP is a public IP that can be used to reach the service. The vip can be used only within the associated OpenStack private network. Both IP addresses wind up in public DNS records. What's the point of returning the vip for a k8s service created with an OpenStack loadbalancer ?

-- fredtran
kubernetes
openstack

1 Answer

9/16/2016

Thats a fair point.

Whats the distinction between the 2 IPs in status? Right now, we just extract all the IPs from service status and put them in DNS records. How do we know which one is supposed to work only within cluster and which one is global?

For reference, here is the relevant code: https://github.com/kubernetes/kubernetes/blob/cf4ea938c882d5f86852994807b18959458033d5/federation/pkg/federation-controller/service/dns.go#L43

Please feel free to file a bug at https://github.com/kubernetes/kubernetes/issues/new or better send a PR to fix that code :)

-- Nikhil Jindal
Source: StackOverflow