<p>I have two kubernetes clusters on GKE: one public that handles interaction with the outside world and one private for internal use only. </p>

<p>The public cluster needs to access some services on the private cluster and I have exposed these to the pods of the public cluster through <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balancing" rel="noreferrer">internal load balancers</a>. Currently I'm specifying the internal IP addresses for the load balancers to use and passing these IPs to the public pods, but I would prefer if the load balancers could choose any available internal IP addresses and I could pass their DNS names to the public pods.</p>

<p><a href="https://cloud.google.com/load-balancing/docs/internal/dns-names" rel="noreferrer">Internal load balancer DNS</a> is available for regular internal load balancers that serve VMs and the DNS will be of the form <code>[SERVICE_LABEL].[FORWARDING_RULE_NAME].il4.[REGION].lb.[PROJECT_ID].internal</code>, but is there something available for internal load balancers on GKE? Or is there a workaround that would enable me to accomplish something similar?</p>

<p>Never heard of built-in DNS for load balancers in GKE, but we do it actually quite simply. We have <a href="https://github.com/kubernetes-incubator/external-dns" rel="noreferrer">External DNS</a> Kubernetes service which manages DNS records for various things like load balancers and ingresses. What you may do:</p>

<ol>
<li>Create Cloud DNS internal zone. Make sure you integrate it with your VPC(s).</li>
<li>Make sure your Kubernetes nodes service account has DNS Administrator (or super wide Editor) permissions.</li>
<li>Install External DNS.</li>
<li>Annotate your internal Load Balancer service with <code>external-dns.alpha.kubernetes.io/hostname=your.hostname.here</code></li>
<li>Verify that DNS record was created and can be resolved within your VPC.</li>
</ol>
