diff --git a/docs/networking/ipv6.md b/docs/networking/ipv6.md index d2cba45276..ef24a075cd 100644 --- a/docs/networking/ipv6.md +++ b/docs/networking/ipv6.md @@ -52,7 +52,3 @@ CNIs must not masquerade IPv6 addresses. ### Calico Running IPv6 with Calico requires a Ubuntu 22.04 or Flatcar based AMI. - -## Future work - -* External-DNS does not, as of the writing of this document, support registering AAAA records. diff --git a/docs/releases/1.27-NOTES.md b/docs/releases/1.27-NOTES.md index bc76c08c6a..d47f3a25eb 100644 --- a/docs/releases/1.27-NOTES.md +++ b/docs/releases/1.27-NOTES.md @@ -9,6 +9,8 @@ This is a document to gather the release notes prior to the release. * The default retention duration for the etcd backups is now set to 90 days. This behaviour can be overridden by setting `spec.etcdClusters[*].manager.backupRetentionDays` in the cluster spec. +* external-dns is now supported in IPv6 clusters. + ## AWS * As of Kubernetes version 1.27, all nodes will default to running with instance-metadata-service tokens required, with a max hop limit of 1. diff --git a/pkg/apis/kops/validation/validation.go b/pkg/apis/kops/validation/validation.go index 742e53dffd..76d735bd6c 100644 --- a/pkg/apis/kops/validation/validation.go +++ b/pkg/apis/kops/validation/validation.go @@ -1875,9 +1875,6 @@ func validateExternalDNS(cluster *kops.Cluster, spec *kops.ExternalDNSConfig, fl if cluster.UsesLegacyGossip() || cluster.UsesNoneDNS() { allErrs = append(allErrs, field.Forbidden(fldPath.Child("provider"), "external-dns requires public or private DNS topology")) } - if cluster.Spec.IsIPv6Only() { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("provider"), "external-dns does not support IPv6 clusters")) - } } return allErrs diff --git a/pkg/resources/aws/aws.go b/pkg/resources/aws/aws.go index e05f9f5518..1c29daf952 100644 --- a/pkg/resources/aws/aws.go +++ b/pkg/resources/aws/aws.go @@ -1827,6 +1827,11 @@ func ListRoute53Records(cloud fi.Cloud, clusterName string) ([]*resources.Resour } prefix := strings.TrimSuffix(name, clusterName) + // Also trim ownership records for AAAA records + if aws.StringValue(rrs.Type) == "TXT" && strings.HasPrefix(prefix, ".aaaa-") { + prefix = "." + strings.TrimPrefix(prefix, ".aaaa-") + } + remove := false // TODO: Compute the actual set of names? if prefix == ".api" || prefix == ".api.internal" || prefix == ".bastion" || prefix == ".kops-controller.internal" { diff --git a/upup/models/cloudup/resources/addons/external-dns.addons.k8s.io/k8s-1.19.yaml.template b/upup/models/cloudup/resources/addons/external-dns.addons.k8s.io/k8s-1.19.yaml.template index 8ad6f051c3..2eb6277509 100644 --- a/upup/models/cloudup/resources/addons/external-dns.addons.k8s.io/k8s-1.19.yaml.template +++ b/upup/models/cloudup/resources/addons/external-dns.addons.k8s.io/k8s-1.19.yaml.template @@ -53,7 +53,7 @@ spec: readOnlyRootFilesystem: true capabilities: drop: ["ALL"] - image: registry.k8s.io/external-dns/external-dns:v0.13.1 + image: registry.k8s.io/external-dns/external-dns:v0.13.5 args: {{ range $arg := ExternalDnsArgv }} - "{{ $arg }}" diff --git a/upup/pkg/fi/cloudup/dns.go b/upup/pkg/fi/cloudup/dns.go index d28511727e..37d351af0d 100644 --- a/upup/pkg/fi/cloudup/dns.go +++ b/upup/pkg/fi/cloudup/dns.go @@ -222,7 +222,11 @@ func precreateDNS(ctx context.Context, cluster *kops.Cluster, cloud fi.Cloud) er } if !foundTXT { if cluster.Spec.ExternalDNS != nil && cluster.Spec.ExternalDNS.Provider == kops.ExternalDNSProviderExternalDNS { - changeset.Add(rrs.New(recordKey.hostname, []string{fmt.Sprintf("\"heritage=external-dns,external-dns/owner=kops-%s\"", cluster.ObjectMeta.Name)}, PlaceholderTTL, rrstype.TXT)) + domain := recordKey.hostname + if ip == PlaceholderIPv6 { + domain = "aaaa-" + domain + } + changeset.Add(rrs.New(domain, []string{fmt.Sprintf("\"heritage=external-dns,external-dns/owner=kops-%s\"", cluster.ObjectMeta.Name)}, PlaceholderTTL, rrstype.TXT)) } } created = append(created, recordKey)