Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/apis/eksctl.io/v1alpha5/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ func (c *ClusterConfig) ValidateVPCConfig() error {
} else if err == nil && version == -1 {
return fmt.Errorf("cluster version must be >= %s", Version1_21)
}
if c.VPC.NAT != nil {
return fmt.Errorf("setting NAT is not supported with IPv6")
}
}
}

Expand Down
21 changes: 21 additions & 0 deletions pkg/apis/eksctl.io/v1alpha5/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ var _ = Describe("ClusterConfig validation", func() {
When("ipFamily is set to IPv6", func() {
It("accepts that setting", func() {
ipv6 := string(api.IPV6Family)
cfg.VPC.NAT = nil
cfg.VPC.IPFamily = &ipv6
cfg.Addons = append(cfg.Addons,
&api.Addon{Name: api.KubeProxyAddon},
Expand All @@ -566,6 +567,7 @@ var _ = Describe("ClusterConfig validation", func() {
It("returns an error", func() {
ipv6 := string(api.IPV6Family)
cfg.VPC.IPFamily = &ipv6
cfg.VPC.NAT = nil
cfg.Addons = append(cfg.Addons,
&api.Addon{Name: api.KubeProxyAddon},
&api.Addon{Name: api.CoreDNSAddon},
Expand All @@ -585,6 +587,7 @@ var _ = Describe("ClusterConfig validation", func() {
When("ipFamily is set ot IPv6 but no managed addons are provided", func() {
It("it returns an error including which addons are missing", func() {
ipv6 := string(api.IPV6Family)
cfg.VPC.NAT = nil
cfg.VPC.IPFamily = &ipv6
cfg.IAM = &api.ClusterIAM{
WithOIDC: api.Enabled(),
Expand Down Expand Up @@ -631,6 +634,24 @@ var _ = Describe("ClusterConfig validation", func() {
Expect(err).To(MatchError(ContainSubstring("invalid value invalid for ipFamily; allowed are IPv4 and IPv6")))
})
})
When("ipFamily is set to IPv6 and vpc.NAT is defined", func() {
It("it returns an error", func() {
ipv6 := string(api.IPV6Family)
cfg.VPC.IPFamily = &ipv6
cfg.Metadata.Version = api.Version1_22
cfg.IAM = &api.ClusterIAM{
WithOIDC: api.Enabled(),
}
cfg.Addons = append(cfg.Addons,
&api.Addon{Name: api.KubeProxyAddon},
&api.Addon{Name: api.CoreDNSAddon},
&api.Addon{Name: api.VPCCNIAddon},
)
cfg.VPC.NAT = &api.ClusterNAT{}
err = cfg.ValidateVPCConfig()
Expect(err).To(MatchError(ContainSubstring("setting NAT is not supported with IPv6")))
})
})
})

Context("CIDRs", func() {
Expand Down
1 change: 1 addition & 0 deletions userdocs/src/usage/vpc-networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ This is an in config file setting only. When IPv6 is set, the following restrict
- OIDC is enabled
- managed addons are defined as shows above
- version must be => 1.21
- setting vpc.NAT is not allowed

The default value is `IPv4`.

Expand Down