-
Notifications
You must be signed in to change notification settings - Fork 641
✨ IPv6 support for self-managed clusters #5603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
6b4c826
986b5e8
4b48513
e17adb5
1c8b976
7d022ad
e60c50c
d428141
6118462
3336db0
c795796
dff77ca
65c25d5
e21265d
25bd540
50cac8e
73c25cf
101c1c0
1cca7b9
e0c6232
57d87ba
abe113a
6f37668
e5dedfa
1c0dc3d
160c6b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -321,6 +321,13 @@ func (s *Service) getNatGatewayPrivateRoute(natGatewayID string) *ec2.CreateRout | |||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| func (s *Service) getNat64PrivateRoute(natGatewayID string) *ec2.CreateRouteInput { | ||||||||||||||
| return &ec2.CreateRouteInput{ | ||||||||||||||
| NatGatewayId: aws.String(natGatewayID), | ||||||||||||||
| DestinationIpv6CidrBlock: aws.String(services.NAT64CidrBlock), | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is NAT64 required to make an operational cluster on AWS? Can we optionally enable it without impact, specially in preferred ipv6? One of concerns of users willing to use IPv6 is the IPv4 costs, on AWS we can't fully eliminate it as public LBs still need it, but I wonder if we can reduce the dependency of Nat Gateways with that new proposal. What do you think? With the preferred IPv6 topology, do we need to allocate one-per-az Nat Gateway (which is a expensive resource)? I wonder if we can create minimum topology (single, or dual, instead per-AZ) of NAT Gateways on IPv6 clusters, helping users to eliminate public IPv4 address from their environment.
Something like: Where:
|
||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| func (s *Service) getEgressOnlyInternetGateway() *ec2.CreateRouteInput { | ||||||||||||||
| return &ec2.CreateRouteInput{ | ||||||||||||||
| DestinationIpv6CidrBlock: aws.String(services.AnyIPv6CidrBlock), | ||||||||||||||
|
|
@@ -415,6 +422,7 @@ func (s *Service) getRoutesToPrivateSubnet(sn *infrav1.SubnetSpec) (routes []*ec | |||||||||||||
|
|
||||||||||||||
| routes = append(routes, s.getNatGatewayPrivateRoute(natGatewayID)) | ||||||||||||||
| if sn.IsIPv6 { | ||||||||||||||
| routes = append(routes, s.getNat64PrivateRoute(natGatewayID)) | ||||||||||||||
|
||||||||||||||
| func (s *Service) getRoutesForSubnet(sn *infrav1.SubnetSpec) ([]*ec2.CreateRouteInput, error) { | |
| if sn.IsPublic { | |
| return s.getRoutesToPublicSubnet(sn) | |
| } | |
| return s.getRoutesToPrivateSubnet(sn) | |
| } |
The func getRoutesToPrivateSubnet is only ever used for getting routes for private subnets :D
Not sure why this was not needed for managed installs
This route is actually a component of DNS64 (NAT64 is always on) to resolve an IPv4-only internet service to a synthetic IPv6 (See here). It is really a nice-to-have feature 🤔 but not required.
My guess was that when Ipv6 was supported for managed eks, they didn't need IPv6-only pods to access IPv4-only internet services.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, I think CAPA currently support IPv6 for EKS by using dualstack subnets. And NAT64/DNS64 is really meant for IPv6-only subnets, not dualstack subnets (unless really necessary).
See details in commit: 78cb9d4
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -545,6 +545,28 @@ func (s *Service) createSubnet(sn *infrav1.SubnetSpec) (*infrav1.SubnetSpec, err | |
| return nil, errors.Wrapf(err, "failed to set subnet %q attribute assign ipv6 address on creation", *out.Subnet.SubnetId) | ||
| } | ||
| record.Eventf(s.scope.InfraCluster(), "SuccessfulModifySubnetAttributes", "Modified managed Subnet %q attributes", *out.Subnet.SubnetId) | ||
|
|
||
| // Enable DNS64 so that the Route 53 Resolver returns DNS records for IPv4-only services | ||
| // containing a synthesized IPv6 address prefixed 64:ff9b::/96. | ||
| // This is needed alongside NAT64 to allow IPv6-only workloads to reach IPv4-only services. | ||
| // We only need to enable on private subnets. | ||
| if !sn.IsPublic { | ||
|
||
| if err := wait.WaitForWithRetryable(wait.NewBackoff(), func() (bool, error) { | ||
| if _, err := s.EC2Client.ModifySubnetAttribute(context.TODO(), &ec2.ModifySubnetAttributeInput{ | ||
| SubnetId: out.Subnet.SubnetId, | ||
| EnableDns64: &types.AttributeBooleanValue{ | ||
| Value: aws.Bool(true), | ||
| }, | ||
| }); err != nil { | ||
| return false, err | ||
| } | ||
| return true, nil | ||
| }, awserrors.SubnetNotFound); err != nil { | ||
| record.Warnf(s.scope.InfraCluster(), "FailedModifySubnetAttributes", "Failed modifying managed Subnet %q attributes: %v", *out.Subnet.SubnetId, err) | ||
| return nil, errors.Wrapf(err, "failed to set subnet %q attribute enable dns64", *out.Subnet.SubnetId) | ||
| } | ||
| record.Eventf(s.scope.InfraCluster(), "SuccessfulModifySubnetAttributes", "Modified managed Subnet %q attributes", *out.Subnet.SubnetId) | ||
| } | ||
| } | ||
|
|
||
| // AWS Wavelength Zone's public subnets does not support to map Carrier IP address on launch, and | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.