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

Scale-up only new machineSet while scale-down all active mSs proportionally #765

Merged
merged 4 commits into from
Jan 23, 2023

Conversation

himanshu-kun
Copy link
Contributor

@himanshu-kun himanshu-kun commented Jan 9, 2023

What this PR does / why we need it:
This PR changes the scaling logic of machineDeployment.
#Before
a scale-up or scale-down lead to proportional splitting of the increase/decrease in replicas among the machineSets as per their size
#Now
a scale-up leads to increase in replicas of the new machineSet only, while scale-down leads to the same proportional scaling as before.

This is done keeping in mind working of autoscaler with MCM. Because during rolling update if autoscaler asked for a scale-up , it used to add machine to the old machineSet(s) during the initial phases of the rolling update. This was inefficient as that machine would be drained later leading to longer rolling update cycle.

Which issue(s) this PR fixes:
Fixes #754

Special notes for your reviewer:
The change is made keeping autoscaler interaction with MCM in mind. Corresponding PR on autoscaler is also raised, to stop autoscaler from scaling down during rolling update operations.

Release note:

If during a rolling update scale-up is done, MCM scales up only the new machineSet, while in case of scale-down the scale-down amount is split among all active machineSets (.i.e. with `.spec.replicas`> 0), in proportion to their sizes.

@himanshu-kun himanshu-kun requested a review from a team as a code owner January 9, 2023 06:44
@gardener-robot gardener-robot added needs/review Needs review size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) labels Jan 9, 2023
@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jan 9, 2023
@himanshu-kun
Copy link
Contributor Author

ran the IT tests. running fine.

@himanshu-kun himanshu-kun force-pushed the scale-only-new-machineset branch from 79f9dca to 7a2d6cb Compare January 10, 2023 13:15
@gardener-robot gardener-robot added size/s Size of pull request is small (see gardener-robot robot/bots/size.py) and removed size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) labels Jan 10, 2023
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jan 10, 2023
@gardener-robot
Copy link

@rishabh-11 You have pull request review open invite, please check

pkg/controller/deployment.go Outdated Show resolved Hide resolved
pkg/controller/deployment.go Outdated Show resolved Hide resolved
pkg/controller/deployment_sync.go Outdated Show resolved Hide resolved
pkg/controller/deployment_sync.go Outdated Show resolved Hide resolved
pkg/controller/deployment_sync.go Outdated Show resolved Hide resolved
pkg/controller/deployment_util.go Outdated Show resolved Hide resolved
pkg/controller/deployment_sync.go Outdated Show resolved Hide resolved
pkg/controller/deployment_sync.go Show resolved Hide resolved
pkg/controller/deployment_sync.go Outdated Show resolved Hide resolved
pkg/controller/deployment_sync.go Outdated Show resolved Hide resolved
@gardener-robot gardener-robot added size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) and removed size/s Size of pull request is small (see gardener-robot robot/bots/size.py) labels Jan 23, 2023
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 23, 2023
Co-authored-by: Madhav Bhargava <[email protected]>
@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jan 23, 2023
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 23, 2023
@himanshu-kun himanshu-kun merged commit dbafe5d into gardener:master Jan 23, 2023
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Jan 23, 2023
@himanshu-kun himanshu-kun deleted the scale-only-new-machineset branch January 23, 2023 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apply machine deployment changes only to latest machine set, never both (e.g. during update)
5 participants