Create Cloud DNS Managed Zone¶
In this section you will create a Cloud DNS managed zone for your desired domain. ExternalDNS will dynamically update the records of this zone based on the Ingress resources in your GKE cluster.
Note
If you already have a Cloud DNS managed zone for your desired domain, you may proceed to the Verify section.
If you are not going to use Cloud DNS to assign an FQDN to your Load
Balancer, you can use Cloud Endpoints
or edit /etc/hosts
manually. You will find instructions for the
aforemetioned alternatives in the guides that follow. You may proceed to the
What’s Next section.
See also
Overview
What You’ll Need¶
- A configured management environment.
- Your clone of the Arrikto GitOps repository.
- An existing GKE cluster.
Procedure¶
Specify the DNS name suffix (domain) for the managed zone:
root@rok-tools:~# export DOMAIN=<DOMAIN>Replace
<DOMAIN>
with your desired domain. For example:root@rok-tools:~# export DOMAIN=apps.example.comSpecify the name of the managed zone:
root@rok-tools:~# export ZONE_NAME=<ZONE_NAME>Replace
<ZONE_NAME>
with your desired zone name. For example:root@rok-tools:~# export ZONE_NAME=gcp-appsCreate a managed zone in Cloud DNS:
root@rok-tools:~# gcloud dns managed-zones create ${ZONE_NAME?} \ > --dns-name=${DOMAIN?}. \ > --description="DNS zone for GCP apps"Obtain the Google Cloud nameservers for your managed zone:
root@rok-tools:~# gcloud dns managed-zones describe ${ZONE_NAME?} --format json | \ > jq -r .nameServers[] ns-cloud-d1.googledomains.com. ns-cloud-d2.googledomains.com. ns-cloud-d3.googledomains.com. ns-cloud-d4.googledomains.com.Update your nameservers to forward DNS queries for
DOMAIN
to the Google Cloud nameservers found above.
Verify¶
Ensure that a managed zone for your desired domain exists:
root@rok-tools:~# gcloud dns managed-zones list --filter dnsName=${DOMAIN?}. NAME DNS_NAME DESCRIPTION VISIBILITY gcp-apps apps.example.com. DNS zone for GCP apps. publicDescribe the zone and inspect the nameServers field:
root@rok-tools:~# gcloud dns managed-zones describe ${ZONE_NAME?} ... nameServers: - ns-cloud-d1.googledomains.com. - ns-cloud-d2.googledomains.com. - ns-cloud-d3.googledomains.com. - ns-cloud-d4.googledomains.com. visibility: publicEnsure that the domain is delegated to the exact same Google Cloud nameservers found above:
root@rok-tools:~# host -t ns ${DOMAIN?} apps.example.com name server ns-cloud-d2.googledomains.com. apps.example.com name server ns-cloud-d4.googledomains.com. apps.example.com name server ns-cloud-d3.googledomains.com. apps.example.com name server ns-cloud-d1.googledomains.com.