Skip to content

Ignore nodes outside configured region#1372

Open
benturnkey wants to merge 1 commit into
kubernetes:masterfrom
benturnkey:ignore-foreign-region-nodes
Open

Ignore nodes outside configured region#1372
benturnkey wants to merge 1 commit into
kubernetes:masterfrom
benturnkey:ignore-foreign-region-nodes

Conversation

@benturnkey
Copy link
Copy Markdown

What type of PR is this?
/kind feature

What this PR does / why we need it:

The AWS cloud provider now ignores nodes whose providerID points to a different AWS region than the controller's configured region when checking instance existence or shutdown state.

Which issue(s) this PR fixes:

Addresses #939 by preventing controllers from interfering with nodes it doesn't own.

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

The AWS cloud provider now ignores nodes whose `providerID` points to a different AWS region than the controller's configured region when checking instance existence or shutdown state.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels Apr 2, 2026
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Apr 2, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: benturnkey / name: Ben Wilson (7058901)

@k8s-ci-robot
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 olemarkus 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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Apr 2, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

This issue is currently awaiting triage.

If cloud-provider-aws contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Apr 2, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @benturnkey!

It looks like this is your first PR to kubernetes/cloud-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/cloud-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. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 2, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @benturnkey. Thanks for your PR.

I'm waiting for a kubernetes 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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 2, 2026
Comment thread pkg/providers/v1/instances_v2_test.go Outdated
Name: "foreign-node",
},
Spec: v1.NodeSpec{
ProviderID: "aws:///us-east-1c/1abc-2def/i-abc",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does 1abc-2def represent here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional custom identifiers. We only ensure region and instance are valid for operation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are custom identifiers supported by the CCM/Kubelet? How do other parts of the CCM already handle the provider ID, is there existing logic that parses the provider ID that we could re-use?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread pkg/providers/v1/instances.go Outdated
Comment on lines +66 to +67
// Assume a bare aws instance id (i-1234...)
// Build a URL with an empty host (AZ)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the instance ID is bare, will it ever have a region prefix? When/why would the instance ID be bare?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the instance ID is bare, will it ever have a region prefix?
No, it was an attempt to coerce the bare instance into something parsable without erroring.

When/why would the instance ID be bare?
Just trying to cover any case.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the instance ID isn't prefixed, and isn't prefixed aws://, I would expect we just ignore the node rather than trying to coerce anything no?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, when you put it that way, yeah.

I'll push a change.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Apr 8, 2026
@benturnkey benturnkey force-pushed the ignore-foreign-region-nodes branch 4 times, most recently from 97f8a0e to 02b1cb7 Compare April 13, 2026 17:15
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 13, 2026
@benturnkey benturnkey force-pushed the ignore-foreign-region-nodes branch from 02b1cb7 to 9ab8eb2 Compare April 13, 2026 17:32
@JoelSpeed
Copy link
Copy Markdown
Contributor

@benturnkey There are a lot of commits in this PR which don't look like they are relevant to the actual goal of the PR, what's going on with those other commits?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 23, 2026
@benturnkey benturnkey force-pushed the ignore-foreign-region-nodes branch from 9ab8eb2 to 7058901 Compare May 7, 2026 02:13
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 7, 2026
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 7, 2026
@benturnkey
Copy link
Copy Markdown
Author

@benturnkey There are a lot of commits in this PR which don't look like they are relevant to the actual goal of the PR, what's going on with those other commits?

Yeah, sorry, I reused the branch for some other testing. Reverted 🙏

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants