-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add 2026-06-15-preview API version for Microsoft.KubernetesConfiguration to add KubernetesResources and UpgradeAssessments #43606
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
Closed
Closed
Changes from 2 commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
c0140db
Add spec for KubeInventory
bgriddaluru 9160baf
Refactor to generic structure
bgriddaluru 4565396
Remove unused paths
bgriddaluru fca5ee8
Fix issues
bgriddaluru 50617fd
refactor
9252164
Fix review comments
4bff9ea
Fix review comments
bgriddaluru 885303d
pretty json
bgriddaluru 75c6991
Remove Provisioning state
bgriddaluru 47ab9d1
Update provisioning state as per rules
bgriddaluru 6f9602a
Compilation and Lint fixes
bgriddaluru 5aa1948
Merge branch 'Azure:main' into main
bgriddaluru b6b0828
Fix tsp formatting
bgriddaluru dca32ef
Merge branch 'Azure:main' into main
bgriddaluru eb1a8f4
Fix lint issues
bgriddaluru 10fd55c
Fix lint issues
bgriddaluru 309da03
Merge branch 'Azure:main' into main
bgriddaluru 15a139d
Add attachedToExtension field
bgriddaluru 797251d
Merge branch 'Azure:main' into main
bgriddaluru 7e22118
Fix review comments
bgriddaluru c5fb5e9
Merge branch 'main' of https://github.com/bgriddaluru/azure-rest-api-…
bgriddaluru 686794e
Split UpgradeAssessment and KubeInventory
bgriddaluru 11525d9
Update Readme
bgriddaluru 16978bc
Remove Provisioning state
bgriddaluru cb287a6
Add more fields and examples
bgriddaluru 85e88d5
Add new words to cspell
bgriddaluru edc5f32
Merge branch 'main' into main
vikeshi26 d5a8bcb
Add more resource type fields
bgriddaluru 14edde0
Merge branch 'Azure:main' into main
bgriddaluru 85fd2dc
Pretty Fixes
bgriddaluru 822274e
Pretty Fixes
bgriddaluru d93a2eb
Fix examples
bgriddaluru cc69385
Update visibility property
bgriddaluru 8e0d251
Merge branch 'Azure:main' into main
bgriddaluru 896b7dc
Fix review comments
bgriddaluru da0b86d
Merge branch 'Azure:main' into main
bgriddaluru 5a979e9
Merge branch 'Azure:main' into main
bgriddaluru 9f5da37
Rename to KubernetesResources and UpgradeAssessments
bgriddaluru 34b7ee7
Merge branch 'main' of https://github.com/bgriddaluru/azure-rest-api-…
bgriddaluru 65103be
Fix file names
bgriddaluru 18381b8
Fix pretty and other examples
bgriddaluru 77e94ff
Merge branch 'Azure:main' into main
bgriddaluru 60cd8b9
Fix pretty
bgriddaluru e5ff801
Revert commit to lease file
bgriddaluru 33bdae5
Update operations to include new api version
bgriddaluru 3bd2c9a
Merge branch 'Azure:main' into main
bgriddaluru bc65e81
Use v6 for the latest version
bgriddaluru eac1a9e
Fix violations
bgriddaluru a983baa
update readme
bgriddaluru 9e9ec99
Fix operations type spec
bgriddaluru 1dd42c8
Fix examples
bgriddaluru ef6db51
Fix pretty
bgriddaluru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
89 changes: 89 additions & 0 deletions
89
...ration/resource-manager/Microsoft.KubernetesConfiguration/kubeInventory/KubeInventory.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
| import "@typespec/rest"; | ||
| import "./models.tsp"; | ||
|
|
||
| using TypeSpec.Rest; | ||
| using Azure.Core; | ||
| using Azure.ResourceManager; | ||
| using Azure.ResourceManager.Foundations; | ||
| using TypeSpec.Http; | ||
|
|
||
| namespace Microsoft.KubernetesConfiguration; | ||
|
|
||
| /** | ||
| * Singleton container resource grouping cluster inventory reports. | ||
| */ | ||
| model KubeInventory is Azure.ResourceManager.ProxyResource<KubeInventoryProperties> { | ||
| ...ResourceNameParameter< | ||
| Resource = KubeInventory, | ||
| KeyName = "kubeInventoryName", | ||
| SegmentName = "kubeInventory", | ||
| NamePattern = "" | ||
| >; | ||
| } | ||
|
|
||
| /** | ||
| * Operations alias for KubeInventory using the cluster extension routing pattern. | ||
| * Generates URLs of the form: | ||
| * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/kubeInventory[/{kubeInventoryName}] | ||
| */ | ||
| alias KubeInventoryOps = Azure.ResourceManager.Legacy.ExtensionOperations< | ||
| { | ||
| ...ApiVersionParameter; | ||
| ...SubscriptionIdParameter; | ||
| ...ResourceGroupParameter; | ||
|
|
||
| /** | ||
| * The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, | ||
| * Microsoft.HybridContainerService. | ||
| */ | ||
| @path | ||
| @segment("providers") | ||
| @key | ||
| clusterRp: string; | ||
|
|
||
| /** | ||
| * The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, | ||
| * provisionedClusters, appliances. | ||
| */ | ||
| @key | ||
| @path | ||
| @pattern("^[a-zA-Z]*$") | ||
|
bgriddaluru marked this conversation as resolved.
Outdated
|
||
| clusterResourceName: string; | ||
|
|
||
| /** | ||
| * The name of the kubernetes cluster. | ||
| */ | ||
| @key | ||
| @path | ||
| @pattern("^.*") | ||
| clusterName: string; | ||
| }, | ||
| { | ||
| ...Azure.ResourceManager.Extension.ExtensionProviderNamespace<KubeInventory>; | ||
| ...ParentKeysOf<KubeInventory>; | ||
| }, | ||
| { | ||
| ...Azure.ResourceManager.Extension.ExtensionProviderNamespace<KubeInventory>; | ||
| ...KeysOf<KubeInventory>; | ||
| } | ||
| >; | ||
|
|
||
| @armResourceOperations(#{ allowStaticRoutes: true, omitTags: true }) | ||
| interface KubeInventories { | ||
| /** | ||
| * Get the kubeInventory singleton for a cluster. | ||
| */ | ||
| @tag("KubeInventory") | ||
| get is KubeInventoryOps.Read<KubeInventory>; | ||
|
|
||
| /** | ||
| * List kubeInventory containers for the cluster (currently always a single 'default'). | ||
| */ | ||
| @tag("KubeInventory") | ||
| list is KubeInventoryOps.List<KubeInventory>; | ||
| } | ||
|
|
||
| @@doc(KubeInventory.name, "Name of the KubeInventory resource."); | ||
| @@doc(KubeInventory.properties, "Properties of the KubeInventory resource."); | ||
165 changes: 165 additions & 0 deletions
165
...on/resource-manager/Microsoft.KubernetesConfiguration/kubeInventory/UpgradeAssessment.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
| import "@typespec/rest"; | ||
| import "./models.tsp"; | ||
| import "./KubeInventory.tsp"; | ||
|
|
||
| using TypeSpec.Rest; | ||
| using Azure.Core; | ||
| using Azure.ResourceManager; | ||
| using Azure.ResourceManager.Foundations; | ||
| using TypeSpec.Http; | ||
|
|
||
| namespace Microsoft.KubernetesConfiguration; | ||
|
|
||
| /** | ||
| * Periodic, cluster-computed Kubernetes upgrade assessment. | ||
| */ | ||
| @parentResource(KubeInventory) | ||
| model UpgradeAssessment is Azure.ResourceManager.ProxyResource<UpgradeAssessmentProperties> { | ||
| ...ResourceNameParameter< | ||
| Resource = UpgradeAssessment, | ||
| KeyName = "assessmentName", | ||
| SegmentName = "upgradeAssessments", | ||
| NamePattern = "" | ||
|
bgriddaluru marked this conversation as resolved.
Outdated
|
||
| >; | ||
| } | ||
|
|
||
| /** | ||
| * Operations alias for UpgradeAssessment using the cluster + KubeInventory extension routing pattern. | ||
| * Generates URLs of the form: | ||
| * .../providers/Microsoft.KubernetesConfiguration/kubeInventory/{kubeInventoryName}/upgradeAssessments[/{assessmentName}] | ||
| */ | ||
| alias UpgradeAssessmentOps = Azure.ResourceManager.Legacy.ExtensionOperations< | ||
| { | ||
| ...ApiVersionParameter; | ||
| ...SubscriptionIdParameter; | ||
| ...ResourceGroupParameter; | ||
|
|
||
| /** | ||
| * The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, | ||
| * Microsoft.HybridContainerService. | ||
| */ | ||
| @path | ||
| @segment("providers") | ||
| @key | ||
| clusterRp: string; | ||
|
|
||
| /** | ||
| * The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, | ||
| * provisionedClusters, appliances. | ||
| */ | ||
| @key | ||
| @path | ||
| @pattern("^[a-zA-Z]*$") | ||
| clusterResourceName: string; | ||
|
|
||
| /** | ||
| * The name of the kubernetes cluster. | ||
| */ | ||
| @key | ||
| @path | ||
| @pattern("^.*") | ||
| clusterName: string; | ||
| }, | ||
| { | ||
| ...Azure.ResourceManager.Extension.ExtensionProviderNamespace<UpgradeAssessment>; | ||
| ...ParentKeysOf<UpgradeAssessment>; | ||
| }, | ||
| { | ||
| ...Azure.ResourceManager.Extension.ExtensionProviderNamespace<UpgradeAssessment>; | ||
| ...ParentKeysOf<UpgradeAssessment>; | ||
| ...KeysOf<UpgradeAssessment>; | ||
| } | ||
| >; | ||
|
|
||
| /** | ||
| * RoutedOperations alias used for the refresh action on a specific UpgradeAssessment instance. | ||
| * Includes all path params up to and including assessmentName so the action route resolves correctly. | ||
| */ | ||
| alias UpgradeAssessmentBuildingOps = Azure.ResourceManager.Legacy.RoutedOperations< | ||
| { | ||
| ...ApiVersionParameter; | ||
| ...SubscriptionIdParameter; | ||
| ...ResourceGroupParameter; | ||
|
|
||
| /** | ||
| * The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, | ||
| * Microsoft.HybridContainerService. | ||
| */ | ||
| @path | ||
| @segment("providers") | ||
| @key | ||
| clusterRp: string; | ||
|
|
||
| /** | ||
| * The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, | ||
| * provisionedClusters, appliances. | ||
| */ | ||
| @key | ||
| @path | ||
| @pattern("^[a-zA-Z]*$") | ||
| clusterResourceName: string; | ||
|
|
||
| /** | ||
| * The name of the kubernetes cluster. | ||
| */ | ||
| @key | ||
| @path | ||
| @pattern("^.*") | ||
| clusterName: string; | ||
|
|
||
| ...KeysOf<KubeInventory>; | ||
| ...KeysOf<UpgradeAssessment>; | ||
| }, | ||
| {}, | ||
| ResourceRoute = #{ | ||
| route: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/kubeInventory", | ||
| } | ||
| >; | ||
|
|
||
| @armResourceOperations(#{ allowStaticRoutes: true, omitTags: true }) | ||
| interface UpgradeAssessments { | ||
| /** | ||
| * Get the upgrade assessment for a cluster. | ||
|
bgriddaluru marked this conversation as resolved.
Outdated
|
||
| */ | ||
| @tag("UpgradeAssessments") | ||
| get is UpgradeAssessmentOps.Read<UpgradeAssessment>; | ||
|
|
||
| /** | ||
| * List upgrade assessments under a kubeInventory (currently always a single 'current'). | ||
| */ | ||
| @tag("UpgradeAssessments") | ||
| list is UpgradeAssessmentOps.List<UpgradeAssessment>; | ||
|
|
||
| /** | ||
| * Internal write path used by the in-cluster agent to publish or update an upgrade assessment. | ||
| * End users do NOT have RBAC for this operation; access is restricted to the cluster's managed identity. | ||
| */ | ||
| @tag("UpgradeAssessments") | ||
| createOrUpdate is UpgradeAssessmentOps.CreateOrUpdateAsync<UpgradeAssessment>; | ||
|
|
||
| /** | ||
| * Trigger the in-cluster agent to recompute the upgrade assessment. | ||
| * Long-running; only one refresh per cluster may be in flight at a time (returns 409 otherwise). | ||
| */ | ||
| @tag("UpgradeAssessments") | ||
| @post | ||
| @route("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/kubeInventory/{kubeInventoryName}/upgradeAssessments/{assessmentName}/refresh") | ||
|
bgriddaluru marked this conversation as resolved.
Outdated
|
||
| refresh is UpgradeAssessmentBuildingOps.ActionAsync< | ||
| UpgradeAssessment, | ||
| RefreshRequest, | ||
| | ArmAcceptedLroResponse<LroHeaders = ArmCombinedLroHeaders<FinalResult = UpgradeAssessment>> | ||
| | ArmResponse<UpgradeAssessment> | ||
| >; | ||
| } | ||
|
|
||
| @@doc(UpgradeAssessment.name, "Name of the UpgradeAssessment resource."); | ||
| @@doc( | ||
| UpgradeAssessment.properties, | ||
| "Properties of the UpgradeAssessment resource." | ||
| ); | ||
| @@doc( | ||
| UpgradeAssessments.createOrUpdate::parameters.resource, | ||
| "The UpgradeAssessment resource body." | ||
| ); | ||
133 changes: 133 additions & 0 deletions
133
...figuration/kubeInventory/examples/2026-06-15-preview/CreateOrUpdateUpgradeAssessment.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| { | ||
| "title": "Create or Update UpgradeAssessment", | ||
| "operationId": "UpgradeAssessments_CreateOrUpdate", | ||
| "parameters": { | ||
| "subscriptionId": "subId1", | ||
| "resourceGroupName": "rg1", | ||
| "clusterRp": "Microsoft.Kubernetes", | ||
| "clusterResourceName": "connectedClusters", | ||
| "clusterName": "clusterName1", | ||
| "kubeInventoryName": "default", | ||
| "assessmentName": "current", | ||
| "api-version": "2026-06-15-preview", | ||
| "resource": { | ||
| "properties": { | ||
| "kubernetesVersion": "1.29", | ||
| "targetKubernetesVersion": "1.30", | ||
| "overallSeverity": "critical", | ||
| "componentCompatibility": [ | ||
| { | ||
| "name": "containerd", | ||
| "version": "1.6.8", | ||
| "compatibilityStatus": "incompatible", | ||
| "severity": "critical", | ||
| "minCompatibleVersion": "1.7.0", | ||
| "notes": "containerd 1.6.x is not compatible with Kubernetes 1.30. Upgrade to 1.7.x required." | ||
| } | ||
| ], | ||
| "deprecatedApis": [ | ||
| { | ||
| "group": "flowcontrol.apiserver.k8s.io", | ||
| "version": "v1beta3", | ||
| "resource": "flowschemas", | ||
| "removedRelease": "1.32", | ||
| "usageMetrics": { | ||
| "get": 12, | ||
| "list": 45 | ||
| }, | ||
| "lastUsageObservedAt": "2026-06-09T14:22:00.000Z", | ||
| "severity": "warning" | ||
| } | ||
| ], | ||
| "readinessChecks": [ | ||
| { | ||
| "category": "NodeStatus", | ||
| "severity": "pass" | ||
| }, | ||
| { | ||
| "category": "Storage", | ||
| "name": "node-pool-1", | ||
| "severity": "critical", | ||
| "details": "Node disk pressure detected; upgrade may fail." | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "body": { | ||
| "id": "/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/kubeInventory/default/upgradeAssessments/current", | ||
| "name": "current", | ||
| "type": "Microsoft.KubernetesConfiguration/kubeInventory/upgradeAssessments", | ||
| "systemData": { | ||
| "createdBy": "cluster-managed-identity", | ||
| "createdByType": "Application", | ||
| "createdAt": "2026-06-01T10:00:00.000Z", | ||
| "lastModifiedBy": "cluster-managed-identity", | ||
| "lastModifiedByType": "Application", | ||
| "lastModifiedAt": "2026-06-10T09:00:00.000Z" | ||
| }, | ||
| "properties": { | ||
| "provisioningState": "Succeeded", | ||
| "assessmentTime": "2026-06-10T09:00:00.000Z", | ||
| "kubernetesVersion": "1.29", | ||
| "targetKubernetesVersion": "1.30", | ||
| "overallSeverity": "critical", | ||
| "componentCompatibility": [ | ||
| { | ||
| "name": "containerd", | ||
| "version": "1.6.8", | ||
| "compatibilityStatus": "incompatible", | ||
| "severity": "critical", | ||
| "minCompatibleVersion": "1.7.0", | ||
| "notes": "containerd 1.6.x is not compatible with Kubernetes 1.30. Upgrade to 1.7.x required." | ||
| } | ||
| ], | ||
| "deprecatedApis": [ | ||
| { | ||
| "group": "flowcontrol.apiserver.k8s.io", | ||
| "version": "v1beta3", | ||
| "resource": "flowschemas", | ||
| "removedRelease": "1.32", | ||
| "usageMetrics": { | ||
| "get": 12, | ||
| "list": 45 | ||
| }, | ||
| "lastUsageObservedAt": "2026-06-09T14:22:00.000Z", | ||
| "severity": "warning" | ||
| } | ||
| ], | ||
| "readinessChecks": [ | ||
| { | ||
| "category": "NodeStatus", | ||
| "severity": "pass" | ||
| }, | ||
| { | ||
| "category": "Storage", | ||
| "name": "node-pool-1", | ||
| "severity": "critical", | ||
| "details": "Node disk pressure detected; upgrade may fail." | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| }, | ||
| "201": { | ||
| "headers": { | ||
| "Azure-AsyncOperation": "https://management.azure.com/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/kubeInventory/default/upgradeAssessments/current/operations/operationId1?api-version=2026-06-15-preview", | ||
| "Retry-After": 10 | ||
| }, | ||
| "body": { | ||
| "id": "/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/kubeInventory/default/upgradeAssessments/current", | ||
| "name": "current", | ||
| "type": "Microsoft.KubernetesConfiguration/kubeInventory/upgradeAssessments", | ||
| "properties": { | ||
| "provisioningState": "Updating", | ||
| "kubernetesVersion": "1.29", | ||
| "targetKubernetesVersion": "1.30" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.