Skip to content

Commit 51f95d2

Browse files
committed
nodeport-sg: allow all ipv4 and ipv6 nodeport ingress rule
FIXME: we should use the VPC CIDR as the source CIDRs. But the IPv6 cidr is not yet knowned at install time. We should edit the awscluster after infraReady to add the VPC IPv6 CIDR as source instead.
1 parent a10c60c commit 51f95d2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pkg/asset/manifests/aws/cluster.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ func GenerateClusterAssets(ic *installconfig.InstallConfig, clusterID *installco
156156
IPv6CidrBlocks: sshRuleCidrs.IPv6Nets().String(),
157157
},
158158
},
159-
NodePortIngressRuleCidrBlocks: capiutils.MachineCIDRsFromInstallConfig(ic).String(),
159+
// FIXME: Use the configured machine network instead
160+
NodePortIngressRuleCidrBlocks: capiutils.AnyWhereCidrBlocks().String(),
160161
},
161162
S3Bucket: &capa.S3Bucket{
162163
Name: GetIgnitionBucketName(clusterID.InfraID),

pkg/asset/manifests/capiutils/helpers.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ func MachineCIDRsFromInstallConfig(ic *installconfig.InstallConfig) ipnet.IPNets
3131
return cidrs
3232
}
3333

34+
// AnyWhereCidrBlocks returns the 0.0.0.0 and ::/0 CIDR blocks.
35+
func AnyWhereCidrBlocks() ipnet.IPNets {
36+
return ipnet.IPNets{
37+
*AnyIPv4CidrBlock, *AnyIPv6CidrBlock,
38+
}
39+
}
40+
3441
// IsEnabled returns true if the feature gate is enabled.
3542
func IsEnabled(installConfig *installconfig.InstallConfig) bool {
3643
// TODO(padillon): refactor to remove IsEnabled function.

0 commit comments

Comments
 (0)