Skip to content

IPv6 targetGroup ipAddressType support #495

@ArbitraryCritter

Description

@ArbitraryCritter

I've been working a bit with setting AWS EKS up in IPv6 only mode with the kube-ingress-aws-controller, combined with the new "--target-access-mode=AWSCNI" mode.

When I say IPv6 only deployment mode, that is not completely true, the nodes have a single IPv4 address but all internal services only have IPv6 and all external IPv4 traffic out of the cluster is NAT'ed to the node ip.
Anyway, the problem with the controller is that there is currently an assumption that all target groups created will only get IPv4 targets, so I end up with an error like this.

level=error msg="unable to register instances ["2a05:d018:1436:ff06:d7ad::a" "2a05:d018:1436:ff08:6caa::4" "2a05:d018:1436:ff08:6caa::5"] in target group arn:aws:elasticloadbalancing:eu-west-1:411286365248:targetgroup/kube-ing-TG-8T26JSGSIFFR/06cd49c411a60939: ValidationError: The IP address '2a05:d018:1436:ff06:d7ad::a' is not a valid IPv4 address\n\tstatus code: 400, request id: 0a50cafd-8b94-40da-b6ce-c116dff991cd"

So everything works and this only fails at the AWS API invocation to register the endpoint, because the targetGroup needs to have the "ipAddressType" set to ipv6.
(See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-targetgroup.html#cfn-elasticloadbalancingv2-targetgroup-ipaddresstype)

Now I actually did checkout the code and took a look at how to implement this. My approach for a solution was to add a --target-group-ip-address-type flag, that would default to "IPV4" but could be overridden to "IPV6" globally. Unfortunately I ran into the problem that the unmaintained "github.com/mweagle/go-cloudformation" that the controller uses, hasn't updated the resource definitions for the targetGroups. It was easy to work around by modifying it manually, but I'm guessing that's not a solution here.

Aside from that, the changes needed seem trivial and low-risk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions