Skip to content

Commit 2c91f48

Browse files
AKS Blue Green Upgrades (#36283)
* feat: update AP models for blue green upgrades * feat: add path for Blue Green upgrade completion * fix: remove 204 status code when completing blue/green ugprades Addresses the following linter error: Long-running POST operations must have responses with 202 and default return codes. They must also have a 200 return code if only if the final response is intended to have a schema, if not the 200 return code must not be specified. They also must not have other response codes. * chore: run prettier
1 parent 6b2a664 commit 2c91f48

File tree

2 files changed

+129
-2
lines changed

2 files changed

+129
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-07-02-preview",
4+
"subscriptionId": "00000000-0000-0000-0000-000000000000",
5+
"resourceGroupName": "rg1",
6+
"resourceName": "clustername1",
7+
"agentPoolName": "agentpool1"
8+
},
9+
"responses": {
10+
"202": {
11+
"headers": {
12+
"location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/00000000-0000-0000-0000-000000000000?api-version=2017-08-31",
13+
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operationStatus/00000000-0000-0000-0000-000000000000?api-version=2017-08-31"
14+
}
15+
}
16+
}
17+
}

specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-07-02-preview/managedClusters.json

Lines changed: 112 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,6 +1707,59 @@
17071707
}
17081708
}
17091709
},
1710+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/completeUpgrade": {
1711+
"post": {
1712+
"tags": [
1713+
"AgentPools"
1714+
],
1715+
"operationId": "AgentPools_CompleteUpgrade",
1716+
"summary": "Completes the upgrade of an agent pool.",
1717+
"description": "Completes the upgrade operation for the specified agent pool.",
1718+
"parameters": [
1719+
{
1720+
"$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter"
1721+
},
1722+
{
1723+
"$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter"
1724+
},
1725+
{
1726+
"$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter"
1727+
},
1728+
{
1729+
"$ref": "#/parameters/ResourceNameParameter"
1730+
},
1731+
{
1732+
"$ref": "#/parameters/AgentPoolNameParameter"
1733+
}
1734+
],
1735+
"responses": {
1736+
"202": {
1737+
"description": "Accepted",
1738+
"headers": {
1739+
"Location": {
1740+
"description": "URL to query for status of the operation.",
1741+
"type": "string"
1742+
}
1743+
}
1744+
},
1745+
"default": {
1746+
"description": "Error response describing why the operation failed.",
1747+
"schema": {
1748+
"$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
1749+
}
1750+
}
1751+
},
1752+
"x-ms-long-running-operation": true,
1753+
"x-ms-long-running-operation-options": {
1754+
"final-state-via": "location"
1755+
},
1756+
"x-ms-examples": {
1757+
"Complete agent pool upgrade": {
1758+
"$ref": "./examples/AgentPoolsCompleteUpgrade.json"
1759+
}
1760+
}
1761+
}
1762+
},
17101763
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines": {
17111764
"post": {
17121765
"tags": [
@@ -5170,9 +5223,35 @@
51705223
"type": "string",
51715224
"description": "The version of node image"
51725225
},
5226+
"upgradeStrategy": {
5227+
"type": "string",
5228+
"description": "Defines the upgrade strategy for the agent pool. The default is Rolling.",
5229+
"enum": [
5230+
"Rolling",
5231+
"BlueGreen"
5232+
],
5233+
"x-ms-enum": {
5234+
"name": "upgradeStrategy",
5235+
"modelAsString": true,
5236+
"values": [
5237+
{
5238+
"value": "Rolling",
5239+
"description": "Specifies that the agent pool will conduct rolling upgrade. This is the default upgrade strategy."
5240+
},
5241+
{
5242+
"value": "BlueGreen",
5243+
"description": "Specifies that the agent pool will conduct blue-green upgrade."
5244+
}
5245+
]
5246+
}
5247+
},
51735248
"upgradeSettings": {
51745249
"$ref": "#/definitions/AgentPoolUpgradeSettings",
5175-
"description": "Settings for upgrading the agentpool"
5250+
"description": "Settings for upgrading the agentpool. Applies when upgrade strategy is set to Rolling."
5251+
},
5252+
"upgradeSettingsBlueGreen": {
5253+
"$ref": "#/definitions/AgentPoolBlueGreenUpgradeSettings",
5254+
"description": "Settings for Blue-Green upgrade on the agentpool. Applies when upgrade strategy is set to BlueGreen."
51765255
},
51775256
"provisioningState": {
51785257
"readOnly": true,
@@ -5589,7 +5668,38 @@
55895668
}
55905669
}
55915670
},
5592-
"description": "Settings for upgrading an agentpool"
5671+
"description": "Settings for rolling upgrade on an agentpool"
5672+
},
5673+
"AgentPoolBlueGreenUpgradeSettings": {
5674+
"type": "object",
5675+
"properties": {
5676+
"drainBatchSize": {
5677+
"type": "string",
5678+
"description": "The number or percentage of nodes to drain in batch during blue-green upgrade. Must be a non-zero number. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total number of blue nodes of the initial upgrade operation. For percentages, fractional nodes are rounded up. If not specified, the default is 10%. For more information, including best practices, see: https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster"
5679+
},
5680+
"drainTimeoutInMinutes": {
5681+
"type": "integer",
5682+
"format": "int32",
5683+
"maximum": 1440,
5684+
"minimum": 1,
5685+
"description": "The drain timeout for a node, i.e., the amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes."
5686+
},
5687+
"batchSoakDurationInMinutes": {
5688+
"type": "integer",
5689+
"format": "int32",
5690+
"maximum": 1440,
5691+
"minimum": 0,
5692+
"description": "The soak duration after draining a batch of nodes, i.e., the amount of time (in minutes) to wait after draining a batch of nodes before moving on the next batch. If not specified, the default is 15 minutes."
5693+
},
5694+
"finalSoakDurationInMinutes": {
5695+
"type": "integer",
5696+
"description": "The soak duration for a node pool, i.e., the amount of time (in minutes) to wait after all old nodes are drained before we remove the old nodes. If not specified, the default is 60 minutes. Only applicable for blue-green upgrade strategy.",
5697+
"format": "int32",
5698+
"maximum": 10080,
5699+
"minimum": 0
5700+
}
5701+
},
5702+
"description": "Settings for blue-green upgrade on an agentpool"
55935703
},
55945704
"AgentPool": {
55955705
"type": "object",

0 commit comments

Comments
 (0)