Skip to content

Commit 9488cb5

Browse files
authored
Merge pull request #3914 from Skarlso/fix_ipv6_self_managed_vpc
Only enable IPv6 if it's already enabled in the config
2 parents 1cbc49c + 00e7142 commit 9488cb5

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

docs/book/src/topics/eks/ipv6-enabled-cluster.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,21 @@ spec:
4343
cidrBlock: "2009:1234:ff00::/56"
4444
```
4545
46+
If you have a VPC that is IPv6 enabled and you would like to use it, please define it in the config:
47+
48+
```yaml
49+
spec:
50+
network:
51+
vpc:
52+
ipv6: {}
53+
```
54+
55+
This has to be done explicitly because otherwise, it would break in the following two scenarios:
56+
- During an upgrade from 1.5 to >=2.0 where the VPC is ipv6 enabled, but CAPA was only recently made aware
57+
- During a migration on the VPC, switching it from only IPv4 to Dual Stack ( it would see that ipv6 is enabled and
58+
enforce it while doing that would not have been the intention of the user )
59+
60+
4661
### Requirements
4762
4863
The use of a Nitro enabled instance is required. To see a list of nitro instances in your region

pkg/cloud/services/network/vpc.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ func (s *Service) reconcileVPC() error {
5252

5353
s.scope.VPC().CidrBlock = vpc.CidrBlock
5454
s.scope.VPC().Tags = vpc.Tags
55-
s.scope.VPC().IPv6 = vpc.IPv6
55+
if s.scope.VPC().IsIPv6Enabled() {
56+
s.scope.VPC().IPv6 = vpc.IPv6
57+
}
5658

5759
// If VPC is unmanaged, return early.
5860
if vpc.IsUnmanaged(s.scope.Name()) {

pkg/cloud/services/network/vpc_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,13 @@ func TestReconcileVPC(t *testing.T) {
351351
},
352352
},
353353
{
354-
name: "should set up IPv6 associations if found VPC is IPv6 enabled",
355-
input: &infrav1.VPCSpec{ID: "unmanaged-vpc-exists", AvailabilityZoneUsageLimit: &usageLimit, AvailabilityZoneSelection: &selection},
354+
name: "should set up IPv6 associations if found VPC is IPv6 enabled",
355+
input: &infrav1.VPCSpec{
356+
ID: "unmanaged-vpc-exists",
357+
IPv6: &infrav1.IPv6{},
358+
AvailabilityZoneUsageLimit: &usageLimit,
359+
AvailabilityZoneSelection: &selection,
360+
},
356361
want: &infrav1.VPCSpec{
357362
ID: "unmanaged-vpc-exists",
358363
CidrBlock: "10.0.0.0/8",

0 commit comments

Comments
 (0)