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

chore: reduce node LIST APIs in cloud-node-manager #986

Merged
merged 3 commits into from
Jan 12, 2022

Conversation

feiskyer
Copy link
Member

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Refer the codes below, cloud-node-manager is querying the node every 5 minutes to reconcile its addresses, but this API call is not actually required as there's already informers:

nodes, err := cnc.kubeClient.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{
ResourceVersion: "0",
FieldSelector: fields.OneTermEqualSelector("metadata.name", cnc.nodeName).String(),
})

Hence, this PR replaces the node LIST with informer LIST, which would reduce the API calls to apiserver.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

chore: reduce node LIST APIs in cloud-node-manager

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@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/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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 Jan 10, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feiskyer

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 Jan 10, 2022
@coveralls
Copy link

coveralls commented Jan 10, 2022

Coverage Status

Coverage increased (+0.06%) to 80.009% when pulling a3d7453 on feiskyer:reduce-client-list into 0e640ad on kubernetes-sigs:master.

@feiskyer
Copy link
Member Author

/hold

@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 Jan 11, 2022
@feiskyer
Copy link
Member Author

/hold cancel

Ready for review now.

@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 Jan 12, 2022
@nilo19
Copy link
Contributor

nilo19 commented Jan 12, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 12, 2022
@nilo19 nilo19 merged commit 8960da4 into kubernetes-sigs:master Jan 12, 2022
@feiskyer feiskyer deleted the reduce-client-list branch January 12, 2022 06:37
k8s-ci-robot added a commit that referenced this pull request Jan 12, 2022
cherry-pick of #986 to release-1.1: reduce node LIST APIs in cloud-node-manager
k8s-ci-robot added a commit that referenced this pull request Jan 12, 2022
cherry-pick of #986 to release-1.23: reduce node LIST APIs in cloud-node-manager
k8s-ci-robot added a commit that referenced this pull request Jan 12, 2022
cherry-pick of #986 to release-1.0: reduce node LIST APIs in cloud-node-manager
@jackfrancis
Copy link
Contributor

Hi @feiskyer @nilo19 can we cut patch releases with this fix ASAP?

Thanks!

@feiskyer
Copy link
Member Author

@jackfrancis we have another set of cherry-picks. Need to wait for them

@feiskyer feiskyer removed the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jan 20, 2022
@feiskyer
Copy link
Member Author

@jackfrancis v1.23.2, v1.1.5 and v1.0.9 have been released with this change.

@jackfrancis
Copy link
Contributor

Thank you @feiskyer!

cc @JohnRusk

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

None yet

5 participants