Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are Google Container Engine instances accessible via DNS?

Google AppEngine apps are automatically accessible via DNS at a predictable location (appname.appspot.com). Is the same true for Google Container Engine instances?

It's simple to give GKE instances a public IP, but this doesn't work well if you want to share demo links (without worrying that they'll change) or use Google OAuth (which does not allow static IPs as callback URLs).

I can register a domain and configure subdomains to point at the IP for each container engine instance using Google Cloud DNS. But it would be simpler if GKE did this already!

like image 628
danvk Avatar asked Mar 08 '16 17:03

danvk


People also ask

How does Google use DNS?

Google Public DNS uses Name Server (NS) records published in the DNS root zone and zones of top-level domains to find the names and addresses of the DNS servers that are authoritative for any domain. Some of those name servers also use anycast routing.

Does Google have DNS servers?

Replace those addresses with the IP addresses of the Google DNS servers: For IPv4: 8.8.8.8 and/or 8.8.4.4 . For IPv6: 2001:4860:4860::8888 and/or 2001:4860:4860::8844 .

How does Kubernetes service DNS work?

Kubernetes DNS schedules a DNS Pod and Service on the cluster, and configures the kubelets to tell individual containers to use the DNS Service's IP to resolve DNS names. Every Service defined in the cluster (including the DNS server itself) is assigned a DNS name.

Is Google DNS a recursive resolver?

Google Public DNS is a recursive DNS resolver, similar to other publicly available services. We think it provides many benefits, including improved security, fast performance, and more valid results.


1 Answers

Google Container Engine does not automatically associate a DNS hostname with either the master endpoint nor any application that you launch in your cluster.

Instances (VMs) in the cluster have public IPs (and you can open firewall rules to make them publicly accessible), but you should generally be contacting services (which represent applications) rather than instances directly.

Services for which you create an external load balancer (L3 or L7) will have a public IP but do not automatically get an associated DNS name.

App Engine promotes a 1:1 relationship between an App (where you are select a globally unique name upon creation if you want an appspot.com domain) and your deployed code.

Container Engine allows you to deploy multiple "apps" in a single cluster, and doesn't require registering a globally unique name when creating the cluster or creating a service. This gives you more flexibility, but also means that if you want to map a DNS name to your application you must do it yourself.

It wouldn't be unreasonable to expect the Ingress controller (used to create L7 services) to help streamline this process, but it doesn't do that today. Feel free to file a feature request on github.

like image 120
Robert Bailey Avatar answered Oct 16 '22 05:10

Robert Bailey