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

Use scale client to Patch the scale subresource when setting the size for a scalableResource #2941

Open
enxebre opened this issue Mar 18, 2020 · 2 comments
Labels
area/cluster-autoscaler area/provider/cluster-api Issues or PRs related to Cluster API provider lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@enxebre
Copy link
Member

enxebre commented Mar 18, 2020

The capi provider autoscaler mutates scalable resources i.e machineSets by using Update() to change the replica number and add annotations to machines. We should instead rely on the scale subresource and making Patch() requests. This is more idiomatic and reduce the surface impacted by Update() calls and its possible side effects

_, updateErr := r.controller.dynamicclient.Resource(*r.controller.machineSetResource).Namespace(u.GetNamespace()).Update(context.TODO(), u, metav1.UpdateOptions{})

/area provider/cluster-api

@k8s-ci-robot k8s-ci-robot added the area/provider/cluster-api Issues or PRs related to Cluster API provider label Mar 18, 2020
@enxebre enxebre changed the title Use scale client to Patch subresource when setting scalable resource size Use scale client to Patch the scale subresource when setting the size for a scalableResource Mar 18, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 28, 2020
@detiber
Copy link
Member

detiber commented Jul 28, 2020

This is partially addressed by #3312 (using the scale client), work would still need to be done to use Patch vs Update, though.

/lifecycle frozen

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cluster-autoscaler area/provider/cluster-api Issues or PRs related to Cluster API provider lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

No branches or pull requests

5 participants