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

AKS: making the count field optional #7746

Merged
merged 6 commits into from
Nov 18, 2019

Conversation

tombuildsstuff
Copy link
Contributor

This PR makes the count field within the Node Pool Properties for a Kubernetes Cluster optional - since whilst it's Required at Creation time it's Optional during Update.

This issue becomes apparently when creating an auto-scaled Node Pool, where you must specify the initial number of nodes, from which point onwards AKS will manage the number of nodes within the Node Pool

Fixes Azure/azure-sdk-for-go#6271

@AutorestCI
Copy link

AutorestCI commented Nov 8, 2019

Automation for azure-sdk-for-python

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-python#8512

@AutorestCI
Copy link

AutorestCI commented Nov 8, 2019

Automation for azure-sdk-for-go

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-go#6371

@azuresdkci
Copy link
Contributor

Can one of the admins verify this patch?

@tombuildsstuff
Copy link
Contributor Author

@jluk FYI. On reflection given only a subset of fields can be updated for both AKS and a Node Pool, would it make sense for Update to have a more specific API endpoint/Swagger definition at some point?

@jluk
Copy link
Contributor

jluk commented Nov 8, 2019

thanks @gtxistxgao for review, + @xizhamsft for vis

@tombuildsstuff having that discussion with a few internal folks wrt a separated upgrade API. let me get back to you on that one.

@jluk
Copy link
Contributor

jluk commented Nov 14, 2019

@tombuildsstuff speaking with @gtxistxgao and @xizhamsft i don't think you'll need this PR anymore as the originally set agentpool count will now be ignored when CA is enabled so you shouldn't run into conflicts.

@tombuildsstuff
Copy link
Contributor Author

@jluk

@tombuildsstuff speaking with @gtxistxgao and @xizhamsft i don't think you'll need this PR anymore as the originally set agentpool count will now be ignored when CA is enabled so you shouldn't run into conflicts.

Based on the test run yesterday this is still needed, since the count field itself is required within the Go SDK based on the logic removed in this PR? From the test failure:

containerservice.AgentPoolsClient#CreateOrUpdate: Invalid input: autorest/validation: validation failed: parameter=parameters.ManagedClusterAgentPoolProfileProperties.Count constraint=Null value=(*int32)(nil) details: value can not be null; required parameter

As such I think this is still needed?

@@ -676,6 +676,9 @@
"x-ms-examples": {
"Create/Update Agent Pool": {
"$ref": "./examples/AgentPoolsCreate_Update.json"
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to update the json file name? since we separate create and update scenario now if I understand correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

these are different examples - one covering Create & Update (using a full object) and another covering a Delta Update, where these optional fields aren't specified

In this example the count field is required for a manually scaled cluster (in the Create/Update example) - but cannot be sent for an automatic cluster (in the Update example)

Copy link
Contributor

Choose a reason for hiding this comment

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

There is no difference between using full object and delta update in Updating scenario. Using full object, the "count" and "vmsize" is also not a required value.

Copy link
Contributor

Choose a reason for hiding this comment

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

May be better to remove the Update in the AgentPoolsCreate_Update.json since it does not applies to Update. But it's out of this PR's scope.

@jluk
Copy link
Contributor

jluk commented Nov 15, 2019

Looks like the PR is good to merge after last open comment is resolved

"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is an example of updating agent pool, the provisioningState in the response could be "Updating", "Upgrading". It cannot be "Succeed"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is copied from the Create/Update response - so I'd suggest if that doesn't match the API definition it'd be worth the service team opening a separate PR for that, since it sounds like the API definition could be out of date?

@tombuildsstuff
Copy link
Contributor Author

👋 is there anything else needed from our side to get this merged? Thanks!

@fengzhou-msft fengzhou-msft merged commit 0328b04 into Azure:master Nov 18, 2019
TalluriAnusha pushed a commit to AsrOneSdk/azure-rest-api-specs that referenced this pull request Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants