Create Google DNS Zone Setup
Prerequisites
- Enable Cloud DNS API.
- install gcloud
- install gcloud component
gcloud components install kubectl - Access to Kubernetes cluster
gcloud auth login. - Update the kubectl configuration to use the plugin
gcloud container clusters get-credentials <your-cluster> --zone <your-cluster-zone>
Steps
-
Create managed DNS Zone
Google Cloud console
-
In the Google Cloud console, go to the Create a DNS zone page.
`Go to Create a DNS zone` -
For the Zone type, select Public.
-
Enter a Zone name such as my-new-zone.
-
Enter a DNS name suffix for the zonegcloud config set project PROJECT_ID using a domain name that you own. All records in the zone share this suffix, for example: example.com.
-
Under DNSSEC, select Off, On, or Transfer. For more information, see Enable DNSSEC for existing managed zones.
-
Click Create. The Zone details page is displayed.
Set the project
- Set the project on which you will create DNS Zone
gcloud config set project PROJECT_ID - Set the project in every command
--project <your-project-id>.
gcloud dns managed-zones create NAME \ --description=DESCRIPTION \ --dns-name=DNS_SUFFIX \ --labels=LABELS \ --visibility=publicReplace Placeholders
DESCRIPTIONwith your description.LABELSwith your label.DNS_SUFFIXwith your main domain or subdomain.
-
-
Get Ingress IP address
check columnkubectl get ingress <your-ingressgateway-name>ADDRESSkubectl get service -n istio-ingress istio-ingressgateway -o jsonpath="{.status.loadBalancer.ingress[0].ip}"- Change namespace
istio-ingressto match your installation.
Note
- You can check Istio setup
- Change namespace
-
Create
Arecord in Cloud DNS-
Set zone for which you will create records
gcloud dns record-sets transaction start --zone=<your-cloud-dns-zone-name> -
Add
Arecordgcloud dns record-sets transaction add <ingress-ip-address> \ --name=dirigible.<your-cloud-dns-zone-name> \ --ttl=300 \ --type=A \ --zone=<your-cloud-dns-zone-name> -
Apply the new record
- Promote ephemeral ip to reservegcloud dns record-sets transaction execute --zone=<your-cloud-dns-zone-name>``` gcloud compute addresses create <name-for-reserver-ip> --addresses=<ingress-ip-address> \ --region=<your-cluster-region> ```-
Get your current DNS records for your zone
gcloud dns record-sets list --zone=<your-cloud-dns-zone-name>
Replace Placeholders
Before run the commands, replace the following placeholders:
<your-cloud-dns-zone-name>with your Google cloud dnz zone name.
-
-
Add name servers
Note
If you configure subdomain add Google name servers to your main domain control panel for this subdomain example:
ns-cloud-d1.googledomains.com,ns-cloud-d2.googledomains.com,ns-cloud-d3.googledomains.com,ns-cloud-d4.googledomains.comNote
At the end you need to update your domain's name servers to use Cloud DNS to publish your new records to the internet. Example:
ns-cloud-d1.googledomains.com,ns-cloud-d2.googledomains.com,ns-cloud-d3.googledomains.com,ns-cloud-d4.googledomains.com
Note