Kubernetes - Automatically populate CloudDNS entries from service endpoints

When starting a Kubernetes cluster on a Google cloud platform, can you somehow have an IP address from service endpoints that are automatically assigned to a Google CloudDNS record? If this can be done declaratively as part of the definition of a YAML service?

Simply put, I do not believe the IP address of my service is type: LoadBalancer .

+6
source share
2 answers

One option is to use an access resource (load balancer) before your services and attach it to the static IP that you previously reserved.

I was not able to find this in Kubernetes or GKE docs, but I found it here:

https://github.com/kelseyhightower/ingress-with-static-ip

Keep in mind that the value you set for the kubernetes.io/ingress.global-static-ip-name annotation is the name of the reserved IP resource, not the IP itself.

Before that, in order to be available, you had to create a global IP address, bind it to the GCE load balancer, which had global targeting of redirection rules in the nodes of your cluster.

I do not believe that there is a way to do this work automatically, today, if you do not want to provide your services using the Ingress load balancer or GCP. However, Ingress is pretty simple, so I would recommend that you go along this route if you can.

There is also a Kubernete incubator project called β€œexternal-dns,” which looks like an add-in that supports this whole and completely from within the cluster itself:

https://github.com/kubernetes-incubator/external-dns

I have not tried this approach yet, but I mention that it hears somehow that you might want to follow.

+1
source

GKE uses the deployment manager to spin new clusters, as well as other resources such as Load Balancers. Currently, the deployment manager does not allow the integration of cloud DNS features. However, there is a feature request to support this . In the future, if this feature is implemented, it may allow further integration between cloud-based DNS, Kubernetes, and GKE.

+1
source

All Articles