-
Notifications
You must be signed in to change notification settings - Fork 558
Scaling Windows agent pools for Availability Sets and VMSS #2859
Conversation
This reverts commit 0eb7ece.
For VMSS, you should be able to scale using portal or CLI, shouldn't need |
@sozercan I agree. |
So @danigian . How is it going with this? |
This updates client-go to v7.0.0 and adds the needed dependencies on `k8s.io/api`. Also fixes a small issue with conflicting `uuid` library versions
make build-vendor passed!
This allows a cluster to scale even if the user has added a subnet to the vnet
@CecileRobertMichon waiting for PR #2954 to be approved as it solves the issues I had (#2869). |
That's great news thank you @danigian! cc: @jackfrancis |
@CecileRobertMichon everything should be ok now
Please do more tests if you want. Thanks |
Codecov Report
@@ Coverage Diff @@
## master #2859 +/- ##
==========================================
- Coverage 51.59% 51.57% -0.02%
==========================================
Files 97 97
Lines 14834 14861 +27
==========================================
+ Hits 7654 7665 +11
- Misses 6482 6496 +14
- Partials 698 700 +2
Continue to review full report at Codecov.
|
Running back compat scale + upgrade tests |
cmd/scale.go
Outdated
@@ -78,6 +79,7 @@ func newScaleCmd() *cobra.Command { | |||
f.BoolVar(&sc.classicMode, "classic-mode", false, "enable classic parameters and outputs") | |||
f.StringVar(&sc.agentPoolToScale, "node-pool", "", "node pool to scale") | |||
f.StringVar(&sc.masterFQDN, "master-FQDN", "", "FQDN for the master load balancer, Needed to scale down Kubernetes agent pools") | |||
f.BoolVar(&sc.windowsPool, "windows", false, "true if windows pool") |
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.
Is it necessary to have a windows flag? Would it be possible to determine if the agentpool is windows based on the names of the VMs?
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.
If there is no other way or it is complicated, it's fine for now but we should add a section in docs about scaling windows agent pools and mention the flag there.
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.
Will work on this now as it should not be a problem removing the flag, using instead the OsType of the OsDisk object in the StorageProfile (should be better than using rather the name which could change in time). In a first moment I added the flag because I thought that could have been useful, but actually it is not
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.
@CecileRobertMichon I ended up with using StorageProfile.ImageReference.Publisher to understand if it is a Windows Agent Pool as the OsType property in the OsDisk Object is not available when using VMSS.
Everything should work as before, but without the windows flag.
Please review this new commit
…s Agent Pool in Scaling scenario
continue | ||
} | ||
|
||
osPublisher := *vm.StorageProfile.ImageReference.Publisher |
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.
I think it'd be cleaner to use *vm.StorageProfile.OsDisk.OsType == Windows
instead
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.
It should be cleaner, however I decided to use the osPublisher as it is the same check done for VMSS (which are not defining OsDisk.OsType).
Do you want me to change this?
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.
Ah that makes sense. All good then.
cmd/scale.go
Outdated
if sc.windowsPool { | ||
_, _, poolindex, err = utils.WindowsVMSSNameParts(*vmss.Name) | ||
osPublisher := *vmss.VirtualMachineProfile.StorageProfile.ImageReference.Publisher | ||
if strings.EqualFold(osPublisher, "MicrosoftWindowsServer") { |
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.
Maybe we can have a bool var isWindows
defined above and re-use it here instead of checking again
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.
I am not sure about what you mean here, sorry. The check happens only one time: when the vmss corresponding to the agent pool, we want to scale, is found.
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.
My bad, I read the code too fast the first time and didn't realize this was VMSS.
I just ran an scale on \examples\windows\kubernetes.json and got the following error:
Am I missing something? |
@CecileRobertMichon i can't reproduce the error. This is what I've got now:
This is what I got from a deployment point of view Let me know Update: I was also able to correctly run the upgrade on this cluster |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Update: Jenkins test was broken, tested back compat manually and it passed. This should be ready to go pending e2e and code review from @jackfrancis. /lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CecileRobertMichon, jackfrancis 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 |
Thank you @danigian!! 🎉 |
What this PR does / why we need it:
This code implements the scaling for Windows agent pools (both for Availability Sets and Virtual Machine Scale Sets)
Which issue this PR fixes:
fixes #1972 #2649
Special notes for your reviewer:
If applicable:
Release note: