Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAPI: Do not normalize Node IDs outside of CAPI provider #3057

Merged
merged 1 commit into from
May 27, 2020

Conversation

JoelSpeed
Copy link
Contributor

When #1866 introduced the CAPI provider, all Provider IDs from nodes were being normalized so that internally, there were no differences (eg some places using normalized, some not)

However, the clusterstateregistry and anything outside of the CPAI provider does not expect the instance IDs to be normalized, and so nodes were being marked as unregistered due to the normalized ID not matching the non-normalized ID coming from the Nodes on the cluster.

This PR makes it so that Instance IDs fetched and passed externally are not normalized, fixing the unregistered node logic in the clusterstateregistry when using the CAPI provider.

/cc @enxebre @elmiko

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 15, 2020
@JoelSpeed
Copy link
Contributor Author

/assign @hardikdr

Copy link
Contributor

@elmiko elmiko left a comment

Choose a reason for hiding this comment

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

nice find Joel!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 15, 2020
@enxebre
Copy link
Member

enxebre commented Apr 15, 2020

Referencing the particular commit which normalized to be able to match nodes/machines d9e3197

However that ^^ only partially fixed the problem. This will still break for some scenarios e.g upstream cluster-api-provider-aws as its providerID does not includes the AZ consistently with the control manager cloud provider. We should probably fix there as well -> https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/22be31dd76da04409c425c77e2967db327f409a4/controllers/awsmachine_controller.go#L406

@JoelSpeed
Copy link
Contributor Author

/hold

Need to make sure this doesn't merge until @enxebre's comment is resolved

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 15, 2020
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 16, 2020
@JoelSpeed
Copy link
Contributor Author

This will need resolving before this PR can be unblocked kubernetes-sigs/cluster-api-provider-aws#1693

@temujin9
Copy link

I can confirm that this patch -- provided as an image by @elmiko -- exhibits the same behavior on AWS without the @enxebre's other change. It looks like the other change just merged; I'll try to test a build with it shortly.

@temujin9
Copy link

That second change finished the trick: my autoscaled nodes now persist for as long as load does, rather than rolling every 10 minutes.

@enxebre
Copy link
Member

enxebre commented May 27, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enxebre

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

The pull request process is described here

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 27, 2020
@elmiko
Copy link
Contributor

elmiko commented May 27, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 27, 2020
@JoelSpeed
Copy link
Contributor Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 27, 2020
@k8s-ci-robot k8s-ci-robot merged commit 0f504d3 into kubernetes:master May 27, 2020
@JoelSpeed JoelSpeed deleted the external-node-ids branch May 27, 2020 14:29
k8s-ci-robot added a commit that referenced this pull request Jun 4, 2020
[CA-1.18] #3057 cherry-pick: CAPI: Do not normalize Node IDs outside of CAPI provider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants