From 94d7cf6fbe36bdfa282fa15be79bcc885f639102 Mon Sep 17 00:00:00 2001 From: Cecile Robert-Michon Date: Fri, 12 Oct 2018 14:33:49 -0700 Subject: [PATCH] Update apiversion to make it consistent in k8s templates (#3909) --- docs/custom-vnet.md | 2 +- docs/extensions.md | 13 ++-- extensions/choco/v1/template-link.json | 4 +- .../hello-world-k8s/v1/template-link.json | 4 +- .../v1/template-link.json | 6 +- .../microsoft-oms-agent-k8s/v1/template.json | 4 +- .../v1/template-link.json | 4 +- .../windows-patches/v1/template-link.json | 4 +- extensions/winrm/v1/template-link.json | 4 +- parts/k8s/kubernetesagentresourcesvmas.t | 43 ++++------ parts/k8s/kubernetesagentresourcesvmss.t | 4 +- parts/k8s/kubernetesbase.t | 8 +- parts/k8s/kubernetesmasterresources.t | 78 ++++++++----------- parts/k8s/kubernetesmasterresourcesvmss.t | 18 ++--- parts/k8s/kubernetesmastervars.t | 24 ++---- parts/k8s/kubernetesmastervarsvmss.t | 22 ++---- parts/k8s/kuberneteswinagentresourcesvmas.t | 41 ++++------ parts/k8s/kuberneteswinagentresourcesvmss.t | 4 +- 18 files changed, 117 insertions(+), 170 deletions(-) diff --git a/docs/custom-vnet.md b/docs/custom-vnet.md index 684d7dc3ad..175eed83b0 100644 --- a/docs/custom-vnet.md +++ b/docs/custom-vnet.md @@ -32,7 +32,7 @@ The Azure Resource Manager template used to deploy this virtual network is: "variables": { }, "resources": [ { - "apiVersion": "2016-03-30", + "apiVersion": "2018-06-01", "location": "[resourceGroup().location]", "name": "ExampleCustomVNET", "properties": { diff --git a/docs/extensions.md b/docs/extensions.md index 94a418a594..c66d32ed6a 100644 --- a/docs/extensions.md +++ b/docs/extensions.md @@ -138,7 +138,7 @@ The following is an example of the template.json file. "description": "Storage API Version" } }, - "apiVersionDefault": { + "apiVersionCompute": { "type": "string", "minLength": 1, "metadata": { @@ -183,7 +183,7 @@ The following is an example of the template.json file. }, "type": "Microsoft.Storage/storageAccounts" }, { - "apiVersion": "[parameters('apiVersionDefault')]", + "apiVersion": "[parameters('apiVersionCompute')]", "dependsOn": [], "location": "[resourceGroup().location]", "type": "Microsoft.Compute/virtualMachines/extensions", @@ -222,7 +222,7 @@ Replace "**EXTENSION-NAME**" with the name of the extension. { "name": "EXTENSION-NAME", "type": "Microsoft.Resources/deployments", - "apiVersion": "[variables('apiVersionLinkDefault')]", + "apiVersion": "[variables('apiVersionCompute')]", "dependsOn": [ "vmLoopNode" ], @@ -233,11 +233,8 @@ Replace "**EXTENSION-NAME**" with the name of the extension. "contentVersion": "1.0.0.0" }, "parameters": { - "apiVersionStorage": { - "value": "[variables('apiVersionStorage')]" - }, - "apiVersionDefault": { - "value": "[variables('apiVersionDefault')]" + "apiVersionCompute": { + "value": "[variables('apiVersionCompute')]" }, "username": { "value": "[parameters('linuxAdminUsername')]" diff --git a/extensions/choco/v1/template-link.json b/extensions/choco/v1/template-link.json index 8cbf281250..302cd8ba31 100644 --- a/extensions/choco/v1/template-link.json +++ b/extensions/choco/v1/template-link.json @@ -1,7 +1,7 @@ { "name": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), 'Choco')]", "type": "Microsoft.Resources/deployments", - "apiVersion": "[variables('apiVersionLinkDefault')]", + "apiVersion": "[variables('apiVersionCompute')]", "dependsOn": [ "[concat('Microsoft.Compute/virtualMachines/', EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), '/extensions/cse', '-EXTENSION_TARGET_VM_TYPE-', copyIndex(EXTENSION_LOOP_OFFSET))]" ], @@ -20,7 +20,7 @@ "value": "EXTENSION_URL_REPLACE" }, "apiVersionCompute": { - "value": "[variables('apiVersionDefault')]" + "value": "[variables('apiVersionCompute')]" }, "targetVMName": { "value": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET))]" diff --git a/extensions/hello-world-k8s/v1/template-link.json b/extensions/hello-world-k8s/v1/template-link.json index 1149534499..c10afbaed8 100644 --- a/extensions/hello-world-k8s/v1/template-link.json +++ b/extensions/hello-world-k8s/v1/template-link.json @@ -1,7 +1,7 @@ { "name": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), 'HelloWorldK8s')]", "type": "Microsoft.Resources/deployments", - "apiVersion": "[variables('apiVersionLinkDefault')]", + "apiVersion": "[variables('apiVersionCompute')]", "dependsOn": [ "[concat('Microsoft.Compute/virtualMachines/', EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), '/extensions/cse', '-EXTENSION_TARGET_VM_TYPE-', copyIndex(EXTENSION_LOOP_OFFSET))]" ], @@ -20,7 +20,7 @@ "value": "EXTENSION_URL_REPLACE" }, "apiVersionCompute": { - "value": "[variables('apiVersionDefault')]" + "value": "[variables('apiVersionCompute')]" }, "targetVMName": { "value": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET))]" diff --git a/extensions/microsoft-oms-agent-k8s/v1/template-link.json b/extensions/microsoft-oms-agent-k8s/v1/template-link.json index b0715f9790..822f0d1b47 100644 --- a/extensions/microsoft-oms-agent-k8s/v1/template-link.json +++ b/extensions/microsoft-oms-agent-k8s/v1/template-link.json @@ -1,7 +1,7 @@ { "name": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), 'MicrosoftOMSAgentk8s')]", "type": "Microsoft.Resources/deployments", - "apiVersion": "[variables('apiVersionLinkDefault')]", + "apiVersion": "[variables('apiVersionCompute')]", "dependsOn": [ "[concat('Microsoft.Compute/virtualMachines/', EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), '/extensions/cse', '-EXTENSION_TARGET_VM_TYPE-', copyIndex(EXTENSION_LOOP_OFFSET))]" ], @@ -19,8 +19,8 @@ "artifactsLocation": { "value": "EXTENSION_URL_REPLACE" }, - "apiVersionDefault": { - "value": "[variables('apiVersionDefault')]" + "apiVersionCompute": { + "value": "[variables('apiVersionCompute')]" }, "targetVMName": { "value": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET))]" diff --git a/extensions/microsoft-oms-agent-k8s/v1/template.json b/extensions/microsoft-oms-agent-k8s/v1/template.json index 399c8a3004..aecd3b1b7a 100644 --- a/extensions/microsoft-oms-agent-k8s/v1/template.json +++ b/extensions/microsoft-oms-agent-k8s/v1/template.json @@ -9,7 +9,7 @@ "description": "Artifacts Location - URL" } }, - "apiVersionDefault": { + "apiVersionCompute": { "type": "string", "minLength": 1, "metadata": { @@ -50,7 +50,7 @@ }, "resources": [ { - "apiVersion": "[parameters('apiVersionDefault')]", + "apiVersion": "[parameters('apiVersionCompute')]", "dependsOn": [], "location": "[resourceGroup().location]", "type": "Microsoft.Compute/virtualMachines/extensions", diff --git a/extensions/prometheus-grafana-k8s/v1/template-link.json b/extensions/prometheus-grafana-k8s/v1/template-link.json index 64474cc151..77395fd511 100644 --- a/extensions/prometheus-grafana-k8s/v1/template-link.json +++ b/extensions/prometheus-grafana-k8s/v1/template-link.json @@ -1,7 +1,7 @@ { "name": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), 'PrometheusGrafanaK8s')]", "type": "Microsoft.Resources/deployments", - "apiVersion": "[variables('apiVersionLinkDefault')]", + "apiVersion": "[variables('apiVersionComput')]", "dependsOn": [ "[concat('Microsoft.Compute/virtualMachines/', EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), '/extensions/cse', '-EXTENSION_TARGET_VM_TYPE-', copyIndex(EXTENSION_LOOP_OFFSET))]" ], @@ -20,7 +20,7 @@ "value": "EXTENSION_URL_REPLACE" }, "apiVersionCompute": { - "value": "[variables('apiVersionDefault')]" + "value": "[variables('apiVersionCompute')]" }, "targetVMName": { "value": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET))]" diff --git a/extensions/windows-patches/v1/template-link.json b/extensions/windows-patches/v1/template-link.json index 00a0a27748..8654043619 100644 --- a/extensions/windows-patches/v1/template-link.json +++ b/extensions/windows-patches/v1/template-link.json @@ -1,7 +1,7 @@ { "name": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), 'windows-patches')]", "type": "Microsoft.Resources/deployments", - "apiVersion": "[variables('apiVersionLinkDefault')]", + "apiVersion": "[variables('apiVersionCompute')]", "dependsOn": [ "[concat('Microsoft.Compute/virtualMachines/', EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), '/extensions/cse', '-EXTENSION_TARGET_VM_TYPE-', copyIndex(EXTENSION_LOOP_OFFSET))]" ], @@ -20,7 +20,7 @@ "value": "EXTENSION_URL_REPLACE" }, "apiVersionCompute": { - "value": "[variables('apiVersionDefault')]" + "value": "[variables('apiVersionCompute')]" }, "targetVMName": { "value": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET))]" diff --git a/extensions/winrm/v1/template-link.json b/extensions/winrm/v1/template-link.json index ddedb4c958..265f7def3c 100644 --- a/extensions/winrm/v1/template-link.json +++ b/extensions/winrm/v1/template-link.json @@ -1,7 +1,7 @@ { "name": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), 'winrm')]", "type": "Microsoft.Resources/deployments", - "apiVersion": "[variables('apiVersionLinkDefault')]", + "apiVersion": "[variables('apiVersionCompute')]", "dependsOn": [ "[concat('Microsoft.Compute/virtualMachines/', EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), '/extensions/cse', '-EXTENSION_TARGET_VM_TYPE-', copyIndex(EXTENSION_LOOP_OFFSET))]" ], @@ -20,7 +20,7 @@ "value": "EXTENSION_URL_REPLACE" }, "apiVersionCompute": { - "value": "[variables('apiVersionDefault')]" + "value": "[variables('apiVersionCompute')]" }, "targetVMName": { "value": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET))]" diff --git a/parts/k8s/kubernetesagentresourcesvmas.t b/parts/k8s/kubernetesagentresourcesvmas.t index 0bc2525eb1..ac45b6ed8a 100644 --- a/parts/k8s/kubernetesagentresourcesvmas.t +++ b/parts/k8s/kubernetesagentresourcesvmas.t @@ -1,9 +1,5 @@ { -{{if .AcceleratedNetworkingEnabled}} - "apiVersion": "2018-04-01", -{{else}} - "apiVersion": "[variables('apiVersionDefault')]", -{{end}} + "apiVersion": "[variables('apiVersionNetwork')]", "copy": { "count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]", "name": "loop" @@ -84,14 +80,15 @@ { "location": "[variables('location')]", "name": "[variables('{{.Name}}AvailabilitySet')]", - "apiVersion": "[variables('apiVersionStorageManagedDisks')]", + "apiVersion": "[variables('apiVersionCompute')]", "properties": { "platformFaultDomainCount": 2, - "platformUpdateDomainCount": 3, - "managed" : "true" + "platformUpdateDomainCount": 3 }, - + "sku": { + "name": "Aligned" + }, "type": "Microsoft.Compute/availabilitySets" }, {{else if .IsStorageAccount}} @@ -110,8 +107,8 @@ {{end}} "location": "[variables('location')]", "name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]", - "properties": { - "accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]" + "sku": { + "name": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]" }, "type": "Microsoft.Storage/storageAccounts" }, @@ -131,8 +128,8 @@ {{end}} "location": "[variables('location')]", "name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(variables('dataStorageAccountPrefixSeed')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(variables('dataStorageAccountPrefixSeed')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}DataAccountName'))]", - "properties": { - "accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]" + "sku": { + "name": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]" }, "type": "Microsoft.Storage/storageAccounts" }, @@ -140,21 +137,13 @@ { "location": "[variables('location')]", "name": "[variables('{{.Name}}AvailabilitySet')]", - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionCompute')]", "properties": {}, "type": "Microsoft.Compute/availabilitySets" }, {{end}} { - {{if UserAssignedIDEnabled}} - "apiVersion": "[variables('apiVersionUserMSI')]", - {{else}} - {{if .IsManagedDisks}} - "apiVersion": "[variables('apiVersionStorageManagedDisks')]", - {{else}} - "apiVersion": "[variables('apiVersionDefault')]", - {{end}} - {{end}} + "apiVersion": "[variables('apiVersionCompute')]", "copy": { "count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]", "name": "vmLoopNode" @@ -271,7 +260,7 @@ {{if UseManagedIdentity}} {{if (not UserAssignedIDEnabled)}} { - "apiVersion": "2014-10-01-preview", + "apiVersion": "[variables('apiVersionCompute')]", "copy": { "count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]", "name": "vmLoopNode" @@ -291,7 +280,7 @@ "count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]", "name": "vmLoopNode" }, - "apiVersion": "2015-05-01-preview", + "apiVersion": "[variables('apiVersionCompute')]", "location": "[resourceGroup().location]", {{if UserAssignedIDEnabled}} "dependsOn": [ @@ -316,7 +305,7 @@ }, {{end}} { - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionCompute')]", "copy": { "count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]", "name": "vmLoopNode" @@ -350,7 +339,7 @@ ,{ "type": "Microsoft.Compute/virtualMachines/extensions", "name": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')), '/computeAksLinuxBilling')]", - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionCompute')]", "copy": { "count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]", "name": "vmLoopNode" diff --git a/parts/k8s/kubernetesagentresourcesvmss.t b/parts/k8s/kubernetesagentresourcesvmss.t index f595ecb0f7..9100d2f4cd 100644 --- a/parts/k8s/kubernetesagentresourcesvmss.t +++ b/parts/k8s/kubernetesagentresourcesvmss.t @@ -1,6 +1,6 @@ {{if and UseManagedIdentity (not UserAssignedIDEnabled)}} { - "apiVersion": "2014-10-01-preview", + "apiVersion": "[variables('apiVersionCompute')]", "name": "[guid(concat('Microsoft.Compute/virtualMachineScaleSets/', variables('{{.Name}}VMNamePrefix'), 'vmidentity'))]", "type": "Microsoft.Authorization/roleAssignments", "properties": { @@ -10,7 +10,7 @@ }, {{end}} { - "apiVersion": "[variables('apiVersionVirtualMachineScaleSets')]", + "apiVersion": "[variables('apiVersionCompute')]", "dependsOn": [ {{if .IsCustomVNET}} "[variables('nsgID')]" diff --git a/parts/k8s/kubernetesbase.t b/parts/k8s/kubernetesbase.t index b7c503a34b..ca061fec04 100644 --- a/parts/k8s/kubernetesbase.t +++ b/parts/k8s/kubernetesbase.t @@ -60,7 +60,7 @@ { "type": "Microsoft.ManagedIdentity/userAssignedIdentities", "name": "[variables('userAssignedID')]", - "apiVersion": "2015-08-31-PREVIEW", + "apiVersion": "[variables('apiVersionCompute')]", "location": "[variables('location')]" }, {{end}} @@ -86,7 +86,7 @@ {{if IsHostedMaster}} {{if not IsCustomVNET}} ,{ - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "dependsOn": [ "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]" {{if not IsAzureCNI}} @@ -125,14 +125,14 @@ {{end}} {{if not IsAzureCNI}} ,{ - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "location": "[variables('location')]", "name": "[variables('routeTableName')]", "type": "Microsoft.Network/routeTables" } {{end}} ,{ - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "location": "[variables('location')]", "name": "[variables('nsgName')]", "properties": { diff --git a/parts/k8s/kubernetesmasterresources.t b/parts/k8s/kubernetesmasterresources.t index d552d8ed62..564134674e 100644 --- a/parts/k8s/kubernetesmasterresources.t +++ b/parts/k8s/kubernetesmasterresources.t @@ -1,19 +1,21 @@ {{if .MasterProfile.IsManagedDisks}} { - "apiVersion": "[variables('apiVersionStorageManagedDisks')]", + "apiVersion": "[variables('apiVersionCompute')]", "location": "[variables('location')]", "name": "[variables('masterAvailabilitySet')]", "properties": - { - "platformFaultDomainCount": 2, - "platformUpdateDomainCount": 3, - "managed" : true - }, + { + "platformFaultDomainCount": 2, + "platformUpdateDomainCount": 3 + }, + "sku": { + "name": "Aligned" + }, "type": "Microsoft.Compute/availabilitySets" }, {{else if .MasterProfile.IsStorageAccount}} { - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionCompute')]", "location": "[variables('location')]", "name": "[variables('masterAvailabilitySet')]", "properties": {}, @@ -28,15 +30,15 @@ {{end}} "location": "[variables('location')]", "name": "[variables('masterStorageAccountName')]", - "properties": { - "accountType": "[variables('vmSizesMap')[parameters('masterVMSize')].storageAccountType]" + "sku": { + "name": "[variables('vmSizesMap')[parameters('masterVMSize')].storageAccountType]" }, "type": "Microsoft.Storage/storageAccounts" }, {{end}} {{if not .MasterProfile.IsCustomVNET}} { - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "dependsOn": [ {{if RequireRouteTable}} "[concat('Microsoft.Network/routeTables/', variables('routeTableName'))]"{{if not IsOpenShift}},{{end}} @@ -78,7 +80,7 @@ }, {{end}} { - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "location": "[variables('location')]", "name": "[variables('nsgName')]", "properties": { @@ -133,7 +135,7 @@ }, {{if RequireRouteTable}} { - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "location": "[variables('location')]", "name": "[variables('routeTableName')]", "type": "Microsoft.Network/routeTables" @@ -141,7 +143,7 @@ {{end}} {{if not IsPrivateCluster}} { - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "location": "[variables('location')]", "name": "[variables('masterPublicIPAddressName')]", "properties": { @@ -153,7 +155,7 @@ "type": "Microsoft.Network/publicIPAddresses" }, { - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "dependsOn": [ "[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]" ], @@ -212,7 +214,7 @@ "type": "Microsoft.Network/loadBalancers" }, { - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "copy": { "count": "[sub(variables('masterCount'), variables('masterOffset'))]", "name": "masterLbLoopNode" @@ -234,7 +236,7 @@ "type": "Microsoft.Network/loadBalancers/inboundNatRules" }, { - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "copy": { "count": "[sub(variables('masterCount'), variables('masterOffset'))]", "name": "nicLoopNode" @@ -325,7 +327,7 @@ }, {{else}} { - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionCompute')]", "copy": { "count": "[sub(variables('masterCount'), variables('masterOffset'))]", "name": "nicLoopNode" @@ -410,11 +412,7 @@ { "type": "Microsoft.Compute/virtualMachines", "name": "[parameters('jumpboxVMName')]", - {{if JumpboxIsManagedDisks}} - "apiVersion": "[variables('apiVersionStorageManagedDisks')]", - {{else}} - "apiVersion": "[variables('apiVersionDefault')]", - {{end}} + "apiVersion": "[variables('apiVersionCompute')]", "location": "[variables('location')]", "properties": { "osProfile": { @@ -480,15 +478,15 @@ "name": "[variables('jumpboxStorageAccountName')]", "apiVersion": "[variables('apiVersionStorage')]", "location": "[variables('location')]", - "properties": { - "accountType": "[variables('vmSizesMap')[parameters('jumpboxVMSize')].storageAccountType]" + "sku": { + "name": "[variables('vmSizesMap')[parameters('jumpboxVMSize')].storageAccountType]" } }, {{end}} { "type": "Microsoft.Network/networkSecurityGroups", "name": "[variables('jumpboxNetworkSecurityGroupName')]", - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "location": "[variables('location')]", "properties": { "securityRules": [ @@ -514,7 +512,7 @@ "name": "Basic" }, "name": "[variables('jumpboxPublicIpAddressName')]", - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "location": "[variables('location')]", "properties": { "dnsSettings": { @@ -526,7 +524,7 @@ { "type": "Microsoft.Network/networkInterfaces", "name": "[variables('jumpboxNetworkInterfaceName')]", - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "location": "[variables('location')]", "properties": { "ipConfigurations": [ @@ -560,7 +558,7 @@ {{end}} {{if gt .MasterProfile.Count 1}} { - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "dependsOn": [ {{if .MasterProfile.IsCustomVNET}} "[variables('nsgID')]" @@ -630,9 +628,9 @@ "name": "[variables('clusterKeyVaultName')]", "apiVersion": "[variables('apiVersionStorage')]", "location": "[variables('location')]", - "properties": { - "accountType": "Standard_LRS" - } + "sku": { + "name": "Standard_LRS" + } }, { "type": "Microsoft.KeyVault/vaults", @@ -720,15 +718,7 @@ }, {{end}} { - {{if UserAssignedIDEnabled}} - "apiVersion": "[variables('apiVersionUserMSI')]", - {{else}} - {{if .MasterProfile.IsManagedDisks}} - "apiVersion": "[variables('apiVersionStorageManagedDisks')]", - {{else}} - "apiVersion": "[variables('apiVersionDefault')]", - {{end}} - {{end}} + "apiVersion": "[variables('apiVersionCompute')]", "copy": { "count": "[sub(variables('masterCount'), variables('masterOffset'))]", "name": "vmLoopNode" @@ -854,7 +844,7 @@ {{if UseManagedIdentity}} {{if (not UserAssignedIDEnabled)}} { - "apiVersion": "2014-10-01-preview", + "apiVersion": "[variables('apiVersionCompute')]", "copy": { "count": "[variables('masterCount')]", "name": "vmLoopNode" @@ -874,7 +864,7 @@ "count": "[variables('masterCount')]", "name": "vmLoopNode" }, - "apiVersion": "2015-05-01-preview", + "apiVersion": "[variables('apiVersionCompute')]", "location": "[resourceGroup().location]", {{if (not UserAssignedIDEnabled)}} "dependsOn": [ @@ -899,7 +889,7 @@ }, {{end}} { - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionCompute')]", "copy": { "count": "[sub(variables('masterCount'), variables('masterOffset'))]", "name": "vmLoopNode" @@ -933,7 +923,7 @@ ,{ "type": "Microsoft.Compute/virtualMachines/extensions", "name": "[concat(variables('masterVMNamePrefix'), copyIndex(variables('masterOffset')), '/computeAksLinuxBilling')]", - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionCompute')]", "copy": { "count": "[sub(variables('masterCount'), variables('masterOffset'))]", "name": "vmLoopNode" diff --git a/parts/k8s/kubernetesmasterresourcesvmss.t b/parts/k8s/kubernetesmasterresourcesvmss.t index 9db269cd4f..502b8fd28e 100644 --- a/parts/k8s/kubernetesmasterresourcesvmss.t +++ b/parts/k8s/kubernetesmasterresourcesvmss.t @@ -1,6 +1,6 @@ {{if and UseManagedIdentity (not UserAssignedIDEnabled)}} { - "apiVersion": "2014-10-01-preview", + "apiVersion": "[variables('apiVersionCompute')]", "name": "[guid(concat('Microsoft.Compute/virtualMachineScaleSets/', variables('masterVMNamePrefix'), 'vmidentity'))]", "type": "Microsoft.Authorization/roleAssignments", "properties": { @@ -15,8 +15,8 @@ "name": "[variables('clusterKeyVaultName')]", "apiVersion": "[variables('apiVersionStorage')]", "location": "[variables('location')]", - "properties": { - "accountType": "Standard_LRS" + "sku": { + "name": "Standard_LRS" } }, { @@ -73,7 +73,7 @@ }, {{end}} { - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "location": "[variables('location')]", "name": "[variables('nsgName')]", "properties": { @@ -128,7 +128,7 @@ }, {{if RequireRouteTable}} { - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "location": "[variables('location')]", "name": "[variables('routeTableName')]", "type": "Microsoft.Network/routeTables" @@ -136,7 +136,7 @@ {{end}} {{if not .MasterProfile.IsCustomVNET}} { - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionNetwork')]", "dependsOn": [ {{if RequireRouteTable}} "[concat('Microsoft.Network/routeTables/', variables('routeTableName'))]", @@ -186,7 +186,7 @@ }, {{end}} { - "apiVersion": "2018-04-01", + "apiVersion": "[variables('apiVersionNetwork')]", "location": "[variables('location')]", "name": "[variables('masterPublicIPAddressName')]", "properties": { @@ -208,7 +208,7 @@ "type": "Microsoft.Network/loadBalancers", "name": "[variables('masterLbName')]", "location": "[variables('location')]", - "apiVersion": "2018-04-01", + "apiVersion": "[variables('apiVersionNetwork')]", "dependsOn": [ "[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]" ], @@ -282,7 +282,7 @@ } }, { - "apiVersion": "[variables('apiVersionVirtualMachineScaleSets')]", + "apiVersion": "[variables('apiVersionCompute')]", "dependsOn": [ {{if .MasterProfile.IsCustomVNET}} "[variables('nsgID')]" diff --git a/parts/k8s/kubernetesmastervars.t b/parts/k8s/kubernetesmastervars.t index a73eb3d87c..8ec715e66a 100644 --- a/parts/k8s/kubernetesmastervars.t +++ b/parts/k8s/kubernetesmastervars.t @@ -83,8 +83,10 @@ "masterCount": {{.MasterProfile.Count}}, "masterOffset": "[parameters('masterOffset')]", {{end}} - "apiVersionDefault": "2016-03-30", - "apiVersionLinkDefault": "2015-01-01", + "apiVersionCompute": "2018-06-01", + "apiVersionStorage": "2018-07-01", + "apiVersionKeyVault": "2018-02-14", + "apiVersionNetwork": "2018-08-01", "locations": [ "[resourceGroup().location]", "[parameters('location')]" @@ -104,7 +106,6 @@ "sshKeyPath": "[concat('/home/',parameters('linuxAdminUsername'),'/.ssh/authorized_keys')]", {{if .HasStorageAccountDisks}} - "apiVersionStorage": "2015-06-15", "maxVMsPerStorageAccount": 20, "maxStorageAccountsPerAgent": "[div(variables('maxVMsPerPool'),variables('maxVMsPerStorageAccount'))]", "dataStorageAccountPrefixSeed": 97, @@ -117,15 +118,6 @@ "storageAccountPrefixes": [], "storageAccountBaseName": "", {{end}} -{{if UserAssignedIDEnabled}} - "apiVersionUserMSI": "2018-06-01", -{{end}} -{{if .HasManagedDisks}} - "apiVersionStorageManagedDisks": "2016-04-30-preview", -{{end}} -{{if .HasVMSSAgentPool}} - "apiVersionVirtualMachineScaleSets": "2017-12-01", -{{end}} {{if not IsHostedMaster}} {{if .MasterProfile.IsStorageAccount}} "masterStorageAccountName": "[concat(variables('storageAccountBaseName'), 'mstr0')]", @@ -306,14 +298,10 @@ ] {{end}} {{if .HasWindows}} - , "windowsCustomScriptSuffix": " $inputFile = '%SYSTEMDRIVE%\\AzureData\\CustomData.bin' ; $outputFile = '%SYSTEMDRIVE%\\AzureData\\CustomDataSetupScript.ps1' ; Copy-Item $inputFile $outputFile ; Invoke-Expression('{0} {1}' -f $outputFile, $arguments) ; " + ,"windowsCustomScriptSuffix": " $inputFile = '%SYSTEMDRIVE%\\AzureData\\CustomData.bin' ; $outputFile = '%SYSTEMDRIVE%\\AzureData\\CustomDataSetupScript.ps1' ; Copy-Item $inputFile $outputFile ; Invoke-Expression('{0} {1}' -f $outputFile, $arguments) ; " {{end}} {{if EnableEncryptionWithExternalKms}} - ,"apiVersionKeyVault": "2016-10-01", - {{if not .HasStorageAccountDisks}} - "apiVersionStorage": "2015-06-15", - {{end}} - "clusterKeyVaultName": "[take(concat('kv', tolower(uniqueString(concat(variables('masterFqdnPrefix'),variables('location'),parameters('nameSuffix'))))), 22)]" + ,"clusterKeyVaultName": "[take(concat('kv', tolower(uniqueString(concat(variables('masterFqdnPrefix'),variables('location'),parameters('nameSuffix'))))), 22)]" {{else}} ,"clusterKeyVaultName": "" {{end}} diff --git a/parts/k8s/kubernetesmastervarsvmss.t b/parts/k8s/kubernetesmastervarsvmss.t index 1dea5cbcb4..c244dc10b1 100644 --- a/parts/k8s/kubernetesmastervarsvmss.t +++ b/parts/k8s/kubernetesmastervarsvmss.t @@ -75,8 +75,10 @@ "masterOffset": "", "masterIpAddressCount": {{.MasterProfile.IPAddressCount}}, {{end}} - "apiVersionDefault": "2016-03-30", - "apiVersionLinkDefault": "2015-01-01", + "apiVersionCompute": "2018-06-01", + "apiVersionStorage": "2018-07-01", + "apiVersionKeyVault": "2018-02-14", + "apiVersionNetwork": "2018-08-01", "locations": [ "[resourceGroup().location]", "[parameters('location')]" @@ -95,7 +97,6 @@ "sshKeyPath": "[concat('/home/',parameters('linuxAdminUsername'),'/.ssh/authorized_keys')]", {{if .HasStorageAccountDisks}} - "apiVersionStorage": "2015-06-15", "maxVMsPerStorageAccount": 20, "maxStorageAccountsPerAgent": "[div(variables('maxVMsPerPool'),variables('maxVMsPerStorageAccount'))]", "dataStorageAccountPrefixSeed": 97, @@ -108,13 +109,6 @@ "storageAccountPrefixes": [], "storageAccountBaseName": "", {{end}} -{{if UserAssignedIDEnabled}} - "apiVersionUserMSI": "2018-06-01", -{{end}} -{{if .HasManagedDisks}} - "apiVersionStorageManagedDisks": "2016-04-30-preview", -{{end}} - "apiVersionVirtualMachineScaleSets": "2017-12-01", {{if not IsHostedMaster}} {{if .MasterProfile.IsStorageAccount}} "masterStorageAccountName": "[concat(variables('storageAccountBaseName'), 'mstr0')]", @@ -272,14 +266,10 @@ ] {{end}} {{if .HasWindows}} - , "windowsCustomScriptSuffix": " $inputFile = '%SYSTEMDRIVE%\\AzureData\\CustomData.bin' ; $outputFile = '%SYSTEMDRIVE%\\AzureData\\CustomDataSetupScript.ps1' ; Copy-Item $inputFile $outputFile ; Invoke-Expression('{0} {1}' -f $outputFile, $arguments) ; " + ,"windowsCustomScriptSuffix": " $inputFile = '%SYSTEMDRIVE%\\AzureData\\CustomData.bin' ; $outputFile = '%SYSTEMDRIVE%\\AzureData\\CustomDataSetupScript.ps1' ; Copy-Item $inputFile $outputFile ; Invoke-Expression('{0} {1}' -f $outputFile, $arguments) ; " {{end}} {{if EnableEncryptionWithExternalKms}} - ,"apiVersionKeyVault": "2016-10-01", - {{if not .HasStorageAccountDisks}} - "apiVersionStorage": "2015-06-15", - {{end}} - "clusterKeyVaultName": "[take(concat('kv', tolower(uniqueString(concat(variables('masterFqdnPrefix'),variables('location'),parameters('nameSuffix'))))), 22)]" + ,"clusterKeyVaultName": "[take(concat('kv', tolower(uniqueString(concat(variables('masterFqdnPrefix'),variables('location'),parameters('nameSuffix'))))), 22)]" {{else}} ,"clusterKeyVaultName": "" {{end}} \ No newline at end of file diff --git a/parts/k8s/kuberneteswinagentresourcesvmas.t b/parts/k8s/kuberneteswinagentresourcesvmas.t index 68f6e39cee..b7947e341e 100644 --- a/parts/k8s/kuberneteswinagentresourcesvmas.t +++ b/parts/k8s/kuberneteswinagentresourcesvmas.t @@ -1,6 +1,6 @@ {{if HasWindowsCustomImage}} {"type": "Microsoft.Compute/images", - "apiVersion": "2017-12-01", + "apiVersion": "[variables('apiVersionCompute')]", "name": "{{.Name}}CustomWindowsImage", "location": "[variables('location')]", "properties": { @@ -16,11 +16,7 @@ }, {{end}} { - {{if .AcceleratedNetworkingEnabled}} - "apiVersion": "2018-04-01", - {{else}} - "apiVersion": "[variables('apiVersionDefault')]", - {{end}} + "apiVersion": "[variables('apiVersionNetwork')]", "copy": { "count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]", "name": "loop" @@ -69,14 +65,15 @@ { "location": "[variables('location')]", "name": "[variables('{{.Name}}AvailabilitySet')]", - "apiVersion": "[variables('apiVersionStorageManagedDisks')]", + "apiVersion": "[variables('apiVersionCompute')]", "properties": { "platformFaultDomainCount": 2, - "platformUpdateDomainCount": 3, - "managed" : "true" + "platformUpdateDomainCount": 3 }, - + "sku": { + "name": "Aligned" + }, "type": "Microsoft.Compute/availabilitySets" }, {{else if .IsStorageAccount}} @@ -95,8 +92,8 @@ {{end}} "location": "[variables('location')]", "name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]", - "properties": { - "accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]" + "sku": { + "name": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]" }, "type": "Microsoft.Storage/storageAccounts" }, @@ -116,8 +113,8 @@ {{end}} "location": "[variables('location')]", "name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(variables('dataStorageAccountPrefixSeed')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(variables('dataStorageAccountPrefixSeed')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}DataAccountName'))]", - "properties": { - "accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]" + "sku": { + "name": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]" }, "type": "Microsoft.Storage/storageAccounts" }, @@ -125,17 +122,13 @@ { "location": "[variables('location')]", "name": "[variables('{{.Name}}AvailabilitySet')]", - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionCompute')]", "properties": {}, "type": "Microsoft.Compute/availabilitySets" }, {{end}} { - {{if .IsManagedDisks}} - "apiVersion": "[variables('apiVersionStorageManagedDisks')]", - {{else}} - "apiVersion": "[variables('apiVersionDefault')]", - {{end}} + "apiVersion": "[variables('apiVersionCompute')]", "copy": { "count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]", "name": "vmLoopNode" @@ -216,7 +209,7 @@ }, {{if UseManagedIdentity}} { - "apiVersion": "2014-10-01-preview", + "apiVersion": "[variables('apiVersionCompute')]", "copy": { "count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]", "name": "vmLoopNode" @@ -235,7 +228,7 @@ "count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]", "name": "vmLoopNode" }, - "apiVersion": "2015-05-01-preview", + "apiVersion": "[variables('apiVersionCompute')]", "location": "[resourceGroup().location]", "dependsOn": [ "[concat('Microsoft.Compute/virtualMachines/', variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')))]", @@ -254,7 +247,7 @@ }, {{end}} { - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionCompute')]", "copy": { "count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]", "name": "vmLoopNode" @@ -284,7 +277,7 @@ ,{ "type": "Microsoft.Compute/virtualMachines/extensions", "name": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')), '/computeAksLinuxBilling')]", - "apiVersion": "[variables('apiVersionDefault')]", + "apiVersion": "[variables('apiVersionCompute')]", "copy": { "count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]", "name": "vmLoopNode" diff --git a/parts/k8s/kuberneteswinagentresourcesvmss.t b/parts/k8s/kuberneteswinagentresourcesvmss.t index 0c32a2385e..2bc2f52e39 100644 --- a/parts/k8s/kuberneteswinagentresourcesvmss.t +++ b/parts/k8s/kuberneteswinagentresourcesvmss.t @@ -1,6 +1,6 @@ {{if UseManagedIdentity}} { - "apiVersion": "2014-10-01-preview", + "apiVersion": "[variables('apiVersionCompute')]", "name": "[guid(concat('Microsoft.Compute/virtualMachineScaleSets/', variables('{{.Name}}VMNamePrefix'), 'vmidentity'))]", "type": "Microsoft.Authorization/roleAssignments", "properties": { @@ -10,7 +10,7 @@ }, {{end}} { - "apiVersion": "[variables('apiVersionVirtualMachineScaleSets')]", + "apiVersion": "[variables('apiVersionCompute')]", "dependsOn": [ {{if .IsCustomVNET}} "[variables('nsgID')]"