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!
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.
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 .
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With