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

Implementing agentpool API #5352

Conversation

xizha162
Copy link
Contributor

@xizha162 xizha162 commented Mar 9, 2019

Implementing agentpool API

There is no data model changes. Just adding the new agentpool (untracked child resource under container service) create/update/delete/list API.

Latest improvements:

MSFT employees can try out our new experience at OpenAPI Hub - one location for using our validation tools and finding your workflow.

Contribution checklist:

  • I have reviewed the documentation for the workflow.
  • Validation tools were run on swagger spec(s) and have all been fixed in this PR.
  • The OpenAPI Hub was used for checking validation status and next steps.

ARM API Review Checklist

  • Service team MUST add the "WaitForARMFeedback" label if the management plane API changes fall into one of the below categories.
  • adding/removing APIs.
  • adding/removing properties.
  • adding/removing API-version.
  • adding a new service in Azure.

Failure to comply may result in delays for manifest application. Note this does not apply to data plane APIs.

  • If you are blocked on ARM review and want to get the PR merged urgently, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.
    Please follow the link to find more details on API review process.

@AutorestCI
Copy link

AutorestCI commented Mar 9, 2019

Automation for azure-sdk-for-python

A PR has been created for you:
Azure/azure-sdk-for-python#4583

@AutorestCI
Copy link

AutorestCI commented Mar 9, 2019

Automation for azure-sdk-for-js

A PR has been created for you:
Azure/azure-sdk-for-js#1591

@AutorestCI
Copy link

AutorestCI commented Mar 9, 2019

Automation for azure-sdk-for-ruby

A PR has been created for you:
Azure/azure-sdk-for-ruby#2313

@AutorestCI
Copy link

AutorestCI commented Mar 9, 2019

Automation for azure-sdk-for-node

A PR has been created for you:
Azure/azure-sdk-for-node#4928

@AutorestCI
Copy link

AutorestCI commented Mar 9, 2019

Automation for azure-sdk-for-java

Nothing to generate for azure-sdk-for-java

@AutorestCI
Copy link

AutorestCI commented Mar 9, 2019

Automation for azure-sdk-for-go

A PR has been created for you:
Azure/azure-sdk-for-go#4245

@azuresdkci
Copy link
Contributor

Can one of the admins verify this patch?

@jhendrixMSFT jhendrixMSFT added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Mar 11, 2019
Copy link
Member

@jhendrixMSFT jhendrixMSFT left a comment

Choose a reason for hiding this comment

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

Change looks good from SDK side, waiting for ARM review.

@sanjaiganesh
Copy link
Contributor

This is adding a new resource type.. please schedule a meeting with ARM team.

@xizha162
Copy link
Contributor Author

@sanjaiganesh, we have done the ARM review meeting for agent pool last year. @kkmsft , @yangl900 can confirm. We are only adding the API into swagger now because the implementation is deployed now.

@kkmsft
Copy link

kkmsft commented Mar 12, 2019

cc @sauryadas @ravbhatnagar

Copy link
Contributor

@ravbhatnagar ravbhatnagar left a comment

Choose a reason for hiding this comment

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

@xizhamsft - some comments. Please feel free to schedule a call, if needed, to close on this.

"description": "The name of the managed cluster resource."
}
],
"responses": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add "default" response to all the API responses. This would capture the error state and the schema must match the error schema as described in ARM RPC. See Batch RP swagger for example

Copy link
Contributor Author

@xizha162 xizha162 Mar 13, 2019

Choose a reason for hiding this comment

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

Good point. Fixed. Added default response.

@@ -531,6 +531,227 @@
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools": {
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 one major problem in these new APIs that are being added now. And yes we reviewed them in the past but never reached a conclusion on the optimal design. The problem is as follows -
Currently, before these new APIs, agentPools is modeled as a property on the managedClusters resource. Its modeled as an array. Now, you are also modeling agentPools as a child resource under managedClusters.
First, child resource payload MUST not be included in the parent resource. It makes PUT very dangerous and few big customers have recently been bitten by this inconsistent PUT behavior in Azure today. Modeling child resources in the parent can potentially make it that much more destructive. If you need a reference to the child resource in the parent, please do so using just ARM resource Ids.
Second, It's unclear how will the PUT on managedCluster work in this case. As part of PUT, can one or more agentPool resources be created?
Third, if you allow multiple to be created, how would subsequent PUTs behave if they dont include an agent Pool which was included in the array and created in the first PUT.
Fourth, such modeling can also potentially break RBAC. If someone was explicitly denied read at the child scope (for whatever reason), they can still read all child resource properties by having read access at the parent.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just want to clarify - the agentPools are proxy only resource, it's not tracked by ARM. Consider it's an API to patch the array in managedClusters. This is similar to Microsoft.Network/virtualNetworks/subnets. I hope this address the first concern.
Regarding the second, as part of PUT managedCluster, client can put multiple agentPools in the array.
Regarding the third, the current PUT API behaves as patch, so if a subsequent PUT doesn't include the agentpool in array, it's considered a patch to the array. In implementation it's a merge of the array, and the reason is that the agentPools is relatively heavy and we want the deletion to be more explicit.
Regarding the fourth the scenario doesn't really apply. Cluster is the minimum unit to manage AKS, if one can read cluster, they should see agentPools. This is similar to vnet/subnet case.

hope this help address the concerns?

Copy link
Contributor

Choose a reason for hiding this comment

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

we call the behavior for 'third' as 'PUTCH' (unofficial term :)) as PUT is behaving like PATCH and it is not recommended.

@ravbhatnagar ravbhatnagar added the ARMChangesRequested <valid label in PR review process>add this label when require changes after ARM review label Mar 13, 2019
@ravbhatnagar
Copy link
Contributor

@kkmsft @sauryadas - FYI please take a look at comments above.

@ravbhatnagar
Copy link
Contributor

Signing off from ARM side. Closed on the plan of action over email. Uber plan is to support multiple agent pool creation using explicit CRUD on child resource type and not through the array on managed cluster.

@ravbhatnagar ravbhatnagar added ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed ARMChangesRequested <valid label in PR review process>add this label when require changes after ARM review ARMReviewMeetingRequired WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Mar 15, 2019
@jhendrixMSFT
Copy link
Member

@xizhamsft has this been deployed yet?

@xizha162
Copy link
Contributor Author

@jhendrixMSFT yes. It has been deployed. But his merge is to the dev branch. I will send out another PR to merge the dev branch to master

@jhendrixMSFT jhendrixMSFT merged commit 354c84c into Azure:dev-containerservice-Microsoft.ContainerService-2019-02-01 Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants