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.
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.
How to reproduce the issue?
By running
eksctl create cluster
with the following config file:What's the error?
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.
https://github.com/eksctl-io/eksctl/blob/4b62d1a3fab80e4c1dfe761e4b7b786b4c976290/pkg/vpc/vpc.go#L131-L146
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.
https://github.com/eksctl-io/eksctl/blob/4b62d1a3fab80e4c1dfe761e4b7b786b4c976290/pkg/cfn/builder/vpc_ipv6.go#L55