How to create dualstack alias to ALB on R53 using ExternalDNS EKS add-on?

172 views Asked by At

I deployed the ExternalDNS add-on/container onto my EKS cluster and it successfully creates Route53 records for all of the Ingress objects with the external-dns.alpha.kubernetes.io/hostname annotation (see below).

The problem is that the current R53 A record alias point to the ipv4 only ALB URL (i.e. not the ALB URL with the dualstack. prefix).

Is there a way that I can instruct the ExternalDNS container that I want my R53 A records to be dualstack?

This is one of my Ingress` objects:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: s1-automation-dev-{{.Chart.Name}}
  annotations:
    alb.ingress.kubernetes.io/scheme: internal
    alb.ingress.kubernetes.io/target-type: ip
    kubernetes.io/ingress.class: alb
    ...
    alb.ingress.kubernetes.io/load-balancer-name: 's1-{{.Chart.Name}}'
 
    external-dns.alpha.kubernetes.io/hostname: ui-dataexplorer.mydomain.com # create Route53 record for the ALB that's created by this ingless
spec:
  rules:
    - http:
        paths:
        - path: /*
          pathType: ImplementationSpecific
          backend:
            service:
              name: {{.Chart.Name}}
              port:
                number: {{ .Values.service.port }}

This is the resulting R53 records for the above Ingress:

enter image description here

Update:

I tried adding alb.ingress.kubernetes.io/ip-address-type: dualstack to the above Ingress object but that just adds another (AAA) record and the loadbalancer is still using ipv4 still:

enter image description here

1

There are 1 answers

3
gohm'c On

The VPC and subnets within must have IPv6 CIDR assigned. Then add the following annotation to your Ingress:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    alb.ingress.kubernetes.io/ip-address-type: dualstack  # <-- add this to create A & AAAA record
    ...