From 3373a52a54c963b0c2ef572726dedf27fbd69cee Mon Sep 17 00:00:00 2001 From: Charlie Li Date: Fri, 6 Aug 2021 17:57:58 -0700 Subject: [PATCH 1/3] Add CreationData property to Agentpool level in 2021-08-01 API --- .../examples/AgentPoolsCreate_Snapshot.json | 61 +++++ .../ManagedClustersCreate_Snapshot.json | 245 ++++++++++++++++++ .../stable/2021-08-01/managedClusters.json | 22 +- 3 files changed, 327 insertions(+), 1 deletion(-) create mode 100644 specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/examples/AgentPoolsCreate_Snapshot.json create mode 100644 specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/examples/ManagedClustersCreate_Snapshot.json diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/examples/AgentPoolsCreate_Snapshot.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/examples/AgentPoolsCreate_Snapshot.json new file mode 100644 index 000000000000..82c5194dfd13 --- /dev/null +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/examples/AgentPoolsCreate_Snapshot.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "api-version": "2021-08-01", + "subscriptionId": "subid1", + "resourceGroupName": "rg1", + "resourceName": "clustername1", + "agentPoolName": "agentpool1", + "parameters": { + "properties": { + "orchestratorVersion": "", + "count": 3, + "vmSize": "Standard_DS2_v2", + "osType": "Linux", + "enableFIPS": true, + "creationData": { + "sourceResourceId": "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1", + "type": "Microsoft.ContainerService/managedClusters/agentPools", + "name": "agentpool1", + "properties": { + "provisioningState": "Succeeded", + "orchestratorVersion": "1.19.6", + "count": 3, + "vmSize": "Standard_DS2_v2", + "maxPods": 110, + "osType": "Linux", + "enableFIPS": true, + "creationData": { + "sourceResourceId": "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1" + } + } + } + }, + "201": { + "body": { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1", + "type": "Microsoft.ContainerService/managedClusters/agentPools", + "name": "agentpool1", + "properties": { + "provisioningState": "Creating", + "orchestratorVersion": "1.19.6", + "count": 3, + "vmSize": "Standard_DS2_v2", + "maxPods": 110, + "osType": "Linux", + "enableFIPS": true, + "creationData": { + "sourceResourceId": "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1" + } + } + } + } + } +} diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/examples/ManagedClustersCreate_Snapshot.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/examples/ManagedClustersCreate_Snapshot.json new file mode 100644 index 000000000000..8b5425d6476a --- /dev/null +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/examples/ManagedClustersCreate_Snapshot.json @@ -0,0 +1,245 @@ +{ + "parameters": { + "api-version": "2021-08-01", + "subscriptionId": "subid1", + "resourceGroupName": "rg1", + "resourceName": "clustername1", + "parameters": { + "location": "location1", + "tags": { + "tier": "production", + "archv2": "" + }, + "sku": { + "name": "Basic", + "tier": "Free" + }, + "properties": { + "kubernetesVersion": "", + "dnsPrefix": "dnsprefix1", + "agentPoolProfiles": [ + { + "name": "nodepool1", + "count": 3, + "vmSize": "Standard_DS2_v2", + "osType": "Linux", + "type": "VirtualMachineScaleSets", + "enableNodePublicIP": true, + "mode": "System", + "enableFIPS": true, + "creationData": { + "sourceResourceId": "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1" + } + } + ], + "linuxProfile": { + "adminUsername": "azureuser", + "ssh": { + "publicKeys": [ + { + "keyData": "keydata" + } + ] + } + }, + "networkProfile": { + "loadBalancerSku": "standard", + "outboundType": "loadBalancer", + "loadBalancerProfile": { + "managedOutboundIPs": { + "count": 2 + } + } + }, + "autoScalerProfile": { + "scan-interval": "20s", + "scale-down-delay-after-add": "15m" + }, + "windowsProfile": { + "adminUsername": "azureuser", + "adminPassword": "replacePassword1234$" + }, + "servicePrincipalProfile": { + "clientId": "clientid", + "secret": "secret" + }, + "addonProfiles": {}, + "enableRBAC": true, + "diskEncryptionSetID": "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + "enablePodSecurityPolicy": false + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1", + "location": "location1", + "name": "clustername1", + "tags": { + "archv2": "", + "tier": "production" + }, + "type": "Microsoft.ContainerService/ManagedClusters", + "properties": { + "provisioningState": "Succeeded", + "maxAgentPools": 1, + "kubernetesVersion": "1.9.6", + "dnsPrefix": "dnsprefix1", + "agentPoolProfiles": [ + { + "name": "nodepool1", + "count": 3, + "vmSize": "Standard_DS2_v2", + "maxPods": 110, + "osType": "Linux", + "provisioningState": "Succeeded", + "orchestratorVersion": "1.9.6", + "type": "VirtualMachineScaleSets", + "enableNodePublicIP": true, + "mode": "System", + "nodeImageVersion": "AKSUbuntu:1604:2020.03.11", + "enableFIPS": true, + "creationData": { + "sourceResourceId": "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1" + } + } + ], + "linuxProfile": { + "adminUsername": "azureuser", + "ssh": { + "publicKeys": [ + { + "keyData": "keydata" + } + ] + } + }, + "windowsProfile": { + "adminUsername": "azureuser" + }, + "servicePrincipalProfile": { + "clientId": "clientid" + }, + "nodeResourceGroup": "MC_rg1_clustername1_location1", + "enableRBAC": true, + "diskEncryptionSetID": "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + "enablePodSecurityPolicy": false, + "fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io", + "networkProfile": { + "loadBalancerSku": "basic", + "networkPlugin": "kubenet", + "podCidr": "10.244.0.0/16", + "serviceCidr": "10.0.0.0/16", + "dnsServiceIP": "10.0.0.10", + "dockerBridgeCidr": "172.17.0.1/16", + "outboundType": "loadBalancer", + "loadBalancerProfile": { + "allocatedOutboundPorts": 2000, + "idleTimeoutInMinutes": 10, + "managedOutboundIPs": { + "count": 2 + }, + "effectiveOutboundIPs": [ + { + "id": "/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1" + }, + { + "id": "/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2" + } + ] + } + }, + "autoScalerProfile": { + "scan-interval": "20s", + "scale-down-delay-after-add": "15m" + } + } + } + }, + "201": { + "body": { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1", + "location": "location1", + "name": "clustername1", + "tags": { + "archv2": "", + "tier": "production" + }, + "type": "Microsoft.ContainerService/ManagedClusters", + "properties": { + "provisioningState": "Creating", + "maxAgentPools": 1, + "kubernetesVersion": "1.9.6", + "dnsPrefix": "dnsprefix1", + "agentPoolProfiles": [ + { + "name": "nodepool1", + "count": 3, + "vmSize": "Standard_DS2_v2", + "maxPods": 110, + "osType": "Linux", + "provisioningState": "Creating", + "orchestratorVersion": "1.9.6", + "type": "VirtualMachineScaleSets", + "enableNodePublicIP": true, + "mode": "System", + "enableFIPS": true, + "creationData": { + "sourceResourceId": "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1" + } + } + ], + "linuxProfile": { + "adminUsername": "azureuser", + "ssh": { + "publicKeys": [ + { + "keyData": "keydata" + } + ] + } + }, + "windowsProfile": { + "adminUsername": "azureuser" + }, + "servicePrincipalProfile": { + "clientId": "clientid" + }, + "nodeResourceGroup": "MC_rg1_clustername1_location1", + "enableRBAC": true, + "diskEncryptionSetID": "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + "enablePodSecurityPolicy": false, + "networkProfile": { + "networkPlugin": "kubenet", + "podCidr": "10.244.0.0/16", + "serviceCidr": "10.0.0.0/16", + "dnsServiceIP": "10.0.0.10", + "dockerBridgeCidr": "172.17.0.1/16", + "loadBalancerSku": "standard", + "outboundType": "loadBalancer", + "loadBalancerProfile": { + "allocatedOutboundPorts": 2000, + "idleTimeoutInMinutes": 10, + "managedOutboundIPs": { + "count": 2 + }, + "effectiveOutboundIPs": [ + { + "id": "/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1" + }, + { + "id": "/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2" + } + ] + } + }, + "autoScalerProfile": { + "scan-interval": "20s", + "scale-down-delay-after-add": "15m" + } + } + } + } + } +} diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/managedClusters.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/managedClusters.json index 0c68c6fd34fd..44c486a3afc8 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/managedClusters.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/managedClusters.json @@ -561,7 +561,10 @@ }, "Create Managed Cluster with user-assigned NAT gateway as outbound type": { "$ref": "./examples/ManagedClustersCreate_UserAssignedNATGateway.json" - } + }, + "Create Managed Cluster using a nodepool snapshot": { + "$ref": "./examples/ManagedClustersCreate_Snapshot.json" + }, } }, "patch": { @@ -1038,6 +1041,9 @@ }, "Create Agent Pool with FIPS enabled OS": { "$ref": "./examples/AgentPoolsCreate_EnableFIPS.json" + }, + "Create Agent Pool using a nodepool snapshot": { + "$ref": "./examples/AgentPoolsCreate_Snapshot.json" } } }, @@ -2496,6 +2502,10 @@ "gpuInstanceProfile": { "$ref": "#/definitions/GPUInstanceProfile", "description": "GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU." + }, + "creationData": { + "$ref": "#/definitions/CreationData", + "description": "CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot." } }, "description": "Properties for the container service agent pool profile." @@ -5054,6 +5064,16 @@ } }, "description": "Azure Defender settings for the security profile." + }, + "CreationData": { + "description": "Data used when creating a target resource from a source resource.", + "type": "object", + "properties": { + "sourceResourceId": { + "type": "string", + "description": "This is the ARM ID of the source object to be used to create the target object." + } + } } }, "parameters": { From 8a494170d7bf39b854067121a34fb5434496ea62 Mon Sep 17 00:00:00 2001 From: Charlie Li Date: Fri, 6 Aug 2021 20:57:26 -0700 Subject: [PATCH 2/3] fix json format --- .../stable/2021-08-01/managedClusters.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/managedClusters.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/managedClusters.json index 44c486a3afc8..6326ff761e4e 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/managedClusters.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/managedClusters.json @@ -564,7 +564,7 @@ }, "Create Managed Cluster using a nodepool snapshot": { "$ref": "./examples/ManagedClustersCreate_Snapshot.json" - }, + } } }, "patch": { From 6595c4a7feb98da1b3e3dffcfafbc35da862129c Mon Sep 17 00:00:00 2001 From: Charlie Li Date: Fri, 6 Aug 2021 21:08:52 -0700 Subject: [PATCH 3/3] fix swagger spell check --- .../stable/2021-08-01/managedClusters.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/managedClusters.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/managedClusters.json index 6326ff761e4e..20cc91bbbd28 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/managedClusters.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-08-01/managedClusters.json @@ -562,7 +562,7 @@ "Create Managed Cluster with user-assigned NAT gateway as outbound type": { "$ref": "./examples/ManagedClustersCreate_UserAssignedNATGateway.json" }, - "Create Managed Cluster using a nodepool snapshot": { + "Create Managed Cluster using an agent pool snapshot": { "$ref": "./examples/ManagedClustersCreate_Snapshot.json" } } @@ -1042,7 +1042,7 @@ "Create Agent Pool with FIPS enabled OS": { "$ref": "./examples/AgentPoolsCreate_EnableFIPS.json" }, - "Create Agent Pool using a nodepool snapshot": { + "Create Agent Pool using an agent pool snapshot": { "$ref": "./examples/AgentPoolsCreate_Snapshot.json" } }