Adding a Google Cloud DNS credential
Add a DNS credential for a public Cloud DNS managed zone by using a service account key.
- You completed Setting up Google Cloud for DNS credentials and have the project ID and the service account key file.
- The DNS preview feature is turned on.
- You have Manager group access in the organization, the Domain Owner or Domain Admin role, or the Admin role.
For the general procedure, see Adding a DNS credential. This topic covers the values for Google Cloud DNS.
The credential appears on the DNS Credentials page. After you save the credential, you can edit only the name and the domain. To change the key or the project, delete the credential and add it again.
When you enable DNS on a project that uses a Google Cloud DNS credential, Cloudera Cloud Factory sets up the following components on the project cluster:
- external-dns runs as the deployment
external-dns-primaryin the namespaceccf-external-dns. It uses thegoogleprovider and the options--google-project=project,--domain-filter=credential-domain, and--policy=sync. The key is in the secretexternal-dns-primary-credsunder the keycredentials.json. The secret is mounted at /etc/gcp and is used through theGOOGLE_APPLICATION_CREDENTIALSenvironment variable. - external-dns marks each record that it creates with a TXT record that holds the owner ID of the project. external-dns changes or deletes only records that carry its own owner ID.
- cert-manager, when the project uses a Let's Encrypt profile, uses the
cloudDNSDNS-01 solver with the same project and key.
The domain filter is the zone of the credential, not the domain of the project. For this reason, external-dns on a project can create records anywhere in the zone. Several projects can share one credential and one zone. Their owner IDs keep their records apart.
To use Let's Encrypt with Google Cloud DNS, you do not need to change the credential. Assign a Let's Encrypt certificate and trust profile to the project, as described in Assigning a profile to a project. cert-manager then uses the cloudDNS DNS-01 solver with the same Google Cloud project and service account key as external-dns. For each certificate, cert-manager writes an _acme-challenge TXT record into the public zone and removes it after issuance. Single-name and wildcard certificates work, and Let's Encrypt requires a public zone.
To check that DNS works, run the following commands:
# Check that external-dns started without errors
kubectl --context=<project> -n ccf-external-dns logs deploy/external-dns-primary | grep -i -E 'google|error'
# List the records in the zone
gcloud dns record-sets list --zone <zone-name> --project <project-id>
# Check public resolution
dig +short <host>.<zone> @1.1.1.1
If the credential is rejected or records do not appear, see Troubleshooting Google Cloud DNS credentials.


