Exclude CNI (secondary) subnets from EKS control plane VPC config - #6173
Conversation
EKS control plane ENIs could be placed in subnets tagged with sigs.k8s.io/cluster-api-provider-aws/association=secondary, making the private endpoint unreachable when the secondary CIDR is non-routable. Apply FilterNonCni in makeVpcConfig, consistent with nodegroup and EC2 instance placement (kubernetes-sigs#4800). Signed-off-by: mmohamed <mmohamed@lfdj.com>
|
|
Welcome @mahmoudmohamed1990! |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @mahmoudmohamed1990. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
EKS control plane ENIs could be placed in subnets tagged with
sigs.k8s.io/cluster-api-provider-aws/association=secondary, becausemakeVpcConfigpasses all subnets from the spec to EKSCreateCluster.When the secondary CIDR is a non-routable range (common CGNAT pattern,
e.g. 100.64.0.0/16), this makes the private endpoint unreachable from
outside the VPC — including from the CAPA management cluster, which then
fails all workload-cluster reconciliation with connection timeouts.
This PR applies
FilterNonCni()inmakeVpcConfig, consistent withnodegroup and EC2 instance placement (see #4800, which introduced the
helper for exactly this purpose but left the control plane path
unfiltered).
No effect on existing clusters — this only affects
CreateClusterinput;reconcileVpcConfigdoes not reconcile SubnetIds.Which issue(s) this PR fixes:
Fixes #6172
Special notes for your reviewer:
Added test cases to
TestMakeVPCConfigcovering CNI subnet exclusion.Checklist:
release-note EKS control plane ENIs are no longer placed in subnets tagged for CNI/pod networking (sigs.k8s.io/cluster-api-provider-aws/association=secondary)