Skip to content

Exclude CNI (secondary) subnets from EKS control plane VPC config - #6173

Open
mahmoudmohamed1990 wants to merge 1 commit into
kubernetes-sigs:mainfrom
mahmoudmohamed1990:fix/eks-controlplane-filter-cni-subnets
Open

Exclude CNI (secondary) subnets from EKS control plane VPC config#6173
mahmoudmohamed1990 wants to merge 1 commit into
kubernetes-sigs:mainfrom
mahmoudmohamed1990:fix/eks-controlplane-filter-cni-subnets

Conversation

@mahmoudmohamed1990

Copy link
Copy Markdown

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, because
makeVpcConfig passes all subnets from the spec to EKS CreateCluster.
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() in makeVpcConfig, consistent with
nodegroup 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 CreateCluster input;
reconcileVpcConfig does not reconcile SubnetIds.

Which issue(s) this PR fixes:
Fixes #6172

Special notes for your reviewer:
Added test cases to TestMakeVPCConfig covering CNI subnet exclusion.

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests

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) ​

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>
@kubernetes-prow kubernetes-prow Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels Jul 31, 2026
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Missing ID

  • ❌ The email address for the commit (6086cfd) is not linked to the GitHub account, preventing the EasyCLA check. Consult this Help Article and GitHub Help to resolve. (To view the commit's email address, add .patch at the end of this PR page's URL.) For further assistance with EasyCLA, please visit our EasyCLA portal and chat with our support bot.

@kubernetes-prow

Copy link
Copy Markdown
Contributor

Welcome @mahmoudmohamed1990!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-aws 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-aws has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign justinsb for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 31, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EKS control plane ENIs are placed in secondary (CNI/pod) subnets — makeVpcConfig doesn't apply FilterNonCni()

1 participant