-
Notifications
You must be signed in to change notification settings - Fork 132
Fix scaling logic in reconcileNewMachineSetInPlace #1052
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
base: master
Are you sure you want to change the base?
Conversation
| } | ||
|
|
||
| if oldMachinesCount+newMachineSet.Spec.Replicas < deployment.Spec.Replicas { | ||
| // Scale up the new machine set to the maximum possible replicas. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This term "maximum possible replicas" could be misleading. Maybe change it to say "deployment replicas"
|
|
||
| if oldMachinesCount+newMachineSet.Spec.Replicas < deployment.Spec.Replicas { | ||
| // Scale up the new machine set to the maximum possible replicas. | ||
| klog.V(3).Infof("scale up the new machine set %s by %d to %d replicas", newMachineSet.Name, (deployment.Spec.Replicas - (oldMachinesCount + newMachineSet.Spec.Replicas)), deployment.Spec.Replicas-oldMachinesCount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This log can be improved a bit. Can you update this to be like the following (feel free to instead add a log line you feel is better suited)
scaling up new machine set <name> from y to z (delta: x)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also assign the expression oldMachinesCount + newMachineSet.Spec.Replicas to variable desiredReplicas to avoid excessive repeat of this expression.
elankath
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the fix.
What this PR does / why we need it:
Adds a check to ensure the new machine set is scaled up when the combined replicas of old and new machine sets are less than the desired deployment replicas. This basically ensures that if a machine is deleted manually from the old machine sets, a new machine should be created in the new machine set with the updated configuration.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note: