From 8c4200d425ccb2ed5c4a86182e422d5cc9deed2f Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Sun, 28 Oct 2018 14:57:31 -0700 Subject: [PATCH] Add DigitalOcean AAAA DNS records on Fedora Atomic --- digital-ocean/fedora-atomic/kubernetes/outputs.tf | 3 ++- digital-ocean/fedora-atomic/kubernetes/workers.tf | 14 +++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/digital-ocean/fedora-atomic/kubernetes/outputs.tf b/digital-ocean/fedora-atomic/kubernetes/outputs.tf index 3f8608af..eaade704 100644 --- a/digital-ocean/fedora-atomic/kubernetes/outputs.tf +++ b/digital-ocean/fedora-atomic/kubernetes/outputs.tf @@ -3,7 +3,8 @@ output "controllers_dns" { } output "workers_dns" { - value = "${digitalocean_record.workers.0.fqdn}" + # Multiple A and AAAA records with the same FQDN + value = "${digitalocean_record.workers-record-a.0.fqdn}" } output "controllers_ipv4" { diff --git a/digital-ocean/fedora-atomic/kubernetes/workers.tf b/digital-ocean/fedora-atomic/kubernetes/workers.tf index ba373902..ee1efac1 100644 --- a/digital-ocean/fedora-atomic/kubernetes/workers.tf +++ b/digital-ocean/fedora-atomic/kubernetes/workers.tf @@ -1,5 +1,5 @@ # Worker DNS records -resource "digitalocean_record" "workers" { +resource "digitalocean_record" "workers-record-a" { count = "${var.worker_count}" # DNS zone where record should be created @@ -11,6 +11,18 @@ resource "digitalocean_record" "workers" { value = "${element(digitalocean_droplet.workers.*.ipv4_address, count.index)}" } +resource "digitalocean_record" "workers-record-aaaa" { + count = "${var.worker_count}" + + # DNS zone where record should be created + domain = "${var.dns_zone}" + + name = "${var.cluster_name}-workers" + type = "AAAA" + ttl = 300 + value = "${element(digitalocean_droplet.workers.*.ipv6_address, count.index)}" +} + # Worker droplet instances resource "digitalocean_droplet" "workers" { count = "${var.worker_count}"