<p>When running a Kubernetes cluster on Google Cloud Platform is it possible to somehow have the IP address from service endpoints automatically assigned to a Google CloudDNS record? If so can this be done declaratively within the service YAML definition?</p>

<p>Simply put I don't trust that the IP address of my <code>type: LoadBalancer</code> service.</p>

<p>One option is to front your services with an ingress resource (load balancer) and attach it to a static IP that you have previously reserved.</p>

<p>I was unable to find this documented in either the Kubernetes or GKE documentation, but I did find it here:</p>

<p><a href="https://github.com/kelseyhightower/ingress-with-static-ip" rel="nofollow noreferrer">https://github.com/kelseyhightower/ingress-with-static-ip</a></p>

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

<p>Previous to that being available, you needed to create a Global IP, attach it to a GCE load balancer which had a global forwarding rule targeting at the nodes of your cluster yourself.</p>

<p>I do not believe there is a way to make this work automatically, today, if you do not wish to front your services with a k8s Ingress or GCP load balancer. That said, the Ingress is pretty straightforward, so I would recommend you go that route, if you can.</p>

<p>There is also a Kubernetes Incubator project called "external-dns" that looks to be an add-on that supports this more generally, and entirely from within the cluster itself:</p>

<p><a href="https://github.com/kubernetes-incubator/external-dns" rel="nofollow noreferrer">https://github.com/kubernetes-incubator/external-dns</a></p>

<p>I have not yet tried that approach, but mention it hear as something you may want to follow.</p>
