Open
Description
How to reproduce the issue?
By running eksctl create cluster
with the following config file:
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: mismatched-subnet-cidr-issue
region: us-west-2
version: "1.30"
availabilityZones:
- us-west-2a
- us-west-2b
- us-west-2c
- us-west-2d
kubernetesNetworkConfig:
ipFamily: IPv6
vpc:
cidr: 10.34.0.0/16
What's the error?
2024-06-13 15:48:39 [✖] getting stack "xxxx-cluster" outputs: could not import subnet subnet-xxxx: mismatch found between local and remote VPC config: subnet CIDR "10.33.224.0/19", found in config file, is not the same as subnet CIDR "10.33.112.0/20", found in remote VPC config
What's the cause?
There's two code sections that handle IPv4 CIDR partitioning that are inconsistent. First section splits the range in the fashion below. The obtained CIDR are then used as-is for IPv4 clusters.
Lines 131 to 146 in 4b62d1a
However, IPv6 logic splits the CIDR in a different fashion, and does not re-use the split obtained previously. Afterwards, eksctl tries to validate that the obtained ranges are consistent, which they aren't. Hence the problem above.
eksctl/pkg/cfn/builder/vpc_ipv6.go
Line 55 in 4b62d1a