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

service controller: update LB nodes updates - update nodes if providerID has changed #120492

Merged
merged 1 commit into from Sep 14, 2023

Conversation

cezarygerard
Copy link
Contributor

service controller: update LB nodes updates - update nodes if providerID has changed

Current implementation will NOT update nodes if Provider ID has changed

Provider ID is added by node controller fraction of the second after the service controller can pick up node changes.

/kind bug

What this PR does / why we need it:

Lack of update after Provider ID was added to the node can result in not adding node to load balancer

Special notes for your reviewer:

This PR should drop the #120311

Please see reviewers' comments in 805d39f
[didn't create PR before amendment changed the commit id]

Does this PR introduce a user-facing change?

NONE

Service Controller: update load balancer hosts after node's ProviderID is updated

@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/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 7, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines 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.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/cloudprovider sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/network Categorizes an issue or PR as relevant to SIG Network. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Sep 7, 2023
@cezarygerard
Copy link
Contributor Author

cezarygerard commented Sep 7, 2023

/assign @thockin
/assign @alexanderConstantinescu
/assign @aojea

expectedUpdateCalls: []fakecloud.UpdateBalancerCall{},
},
{
desc: "Change node with empty empty providerID",

Choose a reason for hiding this comment

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

NIt: empty is mentioned twice

return retSuccess

if nodeNames(newNodes).Equal(nodeNames(oldNodes)) && providerIDsEqual(oldNodes, newNodes) {
return retNeedRetry
Copy link
Member

Choose a reason for hiding this comment

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

Why did this return code change? I feel like I am missing something...

Copy link
Member

Choose a reason for hiding this comment

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

yyeah, sames nodes and with the same providersids looks like means retSuccess

Copy link
Member

Choose a reason for hiding this comment

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

do we want to be paranoid and and check the node.uid too ? kubernetes/cloud-provider-gcp#589 , VMs can be registered with the same name and providerID but be different 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it should be retSuccess here

@alexanderConstantinescu @thockin

I think it's worth to check node UID as Antonio suggested

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OTOH the shouldSyncUpdatedNode dos not check for UID change

maybe it should...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

WDYT?

Choose a reason for hiding this comment

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

Wouldn't keying the nodes by their uid instead of their names, address that? So: nodeUID(newNodes).Equal(nodeUID(oldNodes)).

Copy link
Member

Choose a reason for hiding this comment

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

I like that (with a big comment why :)

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 12, 2023
…providerID has changed

Signed-off-by: czawadka <czawadka@google.com>
@cezarygerard
Copy link
Contributor Author

/retest

@thockin
Copy link
Member

thockin commented Sep 13, 2023

This LGTM. I'll approve and hold. We can either fix this to use UID instead of name, followup to change name to UID, or just use name and put UID in protoNode.

@cezarygerard you can clear the hold if you want to merge this as-is. @alexanderConstantinescu - OK with that?

/lgtm
/approve
/hold

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Sep 13, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: b3d0f0208f1ecc27fef96e42f8370447ea6dda4b

@thockin
Copy link
Member

thockin commented Sep 13, 2023

/retest

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cezarygerard, thockin

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 Sep 13, 2023
@alexanderConstantinescu
Copy link
Member

@alexanderConstantinescu - OK with that?

I'm OK with that

@aojea
Copy link
Member

aojea commented Sep 14, 2023

This LGTM. I'll approve and hold. We can either fix this to use UID instead of name, followup to change name to UID, or just use name and put UID in protoNode.

I vote for "just use name and put UID in protoNode." to have all the information, so we can add a klog.V2() message logging the difference in return reflect.DeepEqual(mOld, mNew) , that will be very useful to troubleshoot problems related to this

@aojea
Copy link
Member

aojea commented Sep 14, 2023

/hold cancel

Seems there is consensus, so I think is good to merge, the node uid problem was not reproduced or at least I didn't see it in the wild neither had time to probe it , so we can move that discussion to #120630 and proceed with this, that is an issue we hit in production

Thanks

@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 Sep 14, 2023
@cezarygerard
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit b8ef1a0 into kubernetes:master Sep 14, 2023
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.29 milestone Sep 14, 2023
k8s-ci-robot added a commit that referenced this pull request Oct 27, 2023
1.26 Cherry pick of #120492: service controller: improve node lifecycle updates - update
k8s-ci-robot added a commit that referenced this pull request Oct 27, 2023
1.27 Cherry pick of #120492: service controller: improve node lifecycle updates - update
k8s-ci-robot added a commit that referenced this pull request Oct 27, 2023
…-#120492-upstream-release-1.28

Automated cherry pick of #120492: service controller: improve node lifecycle updates - update
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. area/cloudprovider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. 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. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/network Categorizes an issue or PR as relevant to SIG Network. 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.

None yet

5 participants