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

🌱 Kcp use one workload cluster for reconcile #8900

Conversation

fabriziopandini
Copy link
Member

What this PR does / why we need it:
As of today, KCP creates the workloadCluster internal struct several times during every reconciliation, and this is one of the factors slowing down reconciliation duration in a way that can impact performance at scale.

This PR refactor KCP so only one workloadCluster internal struct is going to be created and re-used all around during the same reconcile

Which issue(s) this PR fixes:
Part of #8814

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 21, 2023
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 21, 2023
@fabriziopandini
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

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

Nice, just two nits

controlplane/kubeadm/internal/controllers/controller.go Outdated Show resolved Hide resolved
@fabriziopandini
Copy link
Member Author

/retest

@fabriziopandini
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member

/lgtm
code looks good.

Not sure about the unit test failure. Just a guess, maybe a race condition with the cache?

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 22, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 2441217d5c3b7a7e9e6705761acae9f2a8aee955

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 22, 2023
@k8s-ci-robot k8s-ci-robot requested a review from sbueringer June 22, 2023 20:30
@sbueringer
Copy link
Member

sbueringer commented Jun 23, 2023

/lgtm
/approve

/hold
for squash and if you want to wait for other reviews

P.S. I was using this commit yesterday during scale tests and everything worked well

@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 Jun 23, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 69037646a93380793ae4251266b9f201b8abdc61

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 23, 2023
@sbueringer sbueringer mentioned this pull request Jun 23, 2023
27 tasks
@sbueringer
Copy link
Member

/lgtm

(keeping hold for squash)

@fabriziopandini fabriziopandini force-pushed the kcp-use-one-workloadCluster-for-reconcile branch from 67e162d to 479ca19 Compare June 23, 2023 16:07
Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

I haven't tested the performance impact of this, but the changes in the code make complete sense.

/lgtm
/approve

(I think you can unhold whenever you'd like @fabriziopandini)

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: killianmuldoon, sbueringer

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:
  • OWNERS [killianmuldoon,sbueringer]

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

@fabriziopandini
Copy link
Member 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 Jun 23, 2023
@k8s-ci-robot k8s-ci-robot merged commit e174c3a into kubernetes-sigs:main Jun 23, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.5 milestone Jun 23, 2023
@sbueringer
Copy link
Member

I haven't tested the performance impact of this, but the changes in the code make complete sense.

I can't speak about the exact delta, but overall everything worked and the performance got better

@fabriziopandini fabriziopandini deleted the kcp-use-one-workloadCluster-for-reconcile branch June 26, 2023 13:21
@killianmuldoon
Copy link
Contributor

/area provider/control-plane-kubeadm

@k8s-ci-robot k8s-ci-robot added the area/provider/control-plane-kubeadm Issues or PRs related to KCP label Jun 27, 2023
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/provider/control-plane-kubeadm Issues or PRs related to KCP 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants