Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 94d7cf6

Browse files
Cecile Robert-Michonjackfrancis
authored andcommitted
Update apiversion to make it consistent in k8s templates (#3909)
1 parent 4f09c2c commit 94d7cf6

18 files changed

+117
-170
lines changed

docs/custom-vnet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The Azure Resource Manager template used to deploy this virtual network is:
3232
"variables": { },
3333
"resources": [
3434
{
35-
"apiVersion": "2016-03-30",
35+
"apiVersion": "2018-06-01",
3636
"location": "[resourceGroup().location]",
3737
"name": "ExampleCustomVNET",
3838
"properties": {

docs/extensions.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ The following is an example of the template.json file.
138138
"description": "Storage API Version"
139139
}
140140
},
141-
"apiVersionDefault": {
141+
"apiVersionCompute": {
142142
"type": "string",
143143
"minLength": 1,
144144
"metadata": {
@@ -183,7 +183,7 @@ The following is an example of the template.json file.
183183
},
184184
"type": "Microsoft.Storage/storageAccounts"
185185
}, {
186-
"apiVersion": "[parameters('apiVersionDefault')]",
186+
"apiVersion": "[parameters('apiVersionCompute')]",
187187
"dependsOn": [],
188188
"location": "[resourceGroup().location]",
189189
"type": "Microsoft.Compute/virtualMachines/extensions",
@@ -222,7 +222,7 @@ Replace "**EXTENSION-NAME**" with the name of the extension.
222222
{
223223
"name": "EXTENSION-NAME",
224224
"type": "Microsoft.Resources/deployments",
225-
"apiVersion": "[variables('apiVersionLinkDefault')]",
225+
"apiVersion": "[variables('apiVersionCompute')]",
226226
"dependsOn": [
227227
"vmLoopNode"
228228
],
@@ -233,11 +233,8 @@ Replace "**EXTENSION-NAME**" with the name of the extension.
233233
"contentVersion": "1.0.0.0"
234234
},
235235
"parameters": {
236-
"apiVersionStorage": {
237-
"value": "[variables('apiVersionStorage')]"
238-
},
239-
"apiVersionDefault": {
240-
"value": "[variables('apiVersionDefault')]"
236+
"apiVersionCompute": {
237+
"value": "[variables('apiVersionCompute')]"
241238
},
242239
"username": {
243240
"value": "[parameters('linuxAdminUsername')]"

extensions/choco/v1/template-link.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), 'Choco')]",
33
"type": "Microsoft.Resources/deployments",
4-
"apiVersion": "[variables('apiVersionLinkDefault')]",
4+
"apiVersion": "[variables('apiVersionCompute')]",
55
"dependsOn": [
66
"[concat('Microsoft.Compute/virtualMachines/', EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), '/extensions/cse', '-EXTENSION_TARGET_VM_TYPE-', copyIndex(EXTENSION_LOOP_OFFSET))]"
77
],
@@ -20,7 +20,7 @@
2020
"value": "EXTENSION_URL_REPLACE"
2121
},
2222
"apiVersionCompute": {
23-
"value": "[variables('apiVersionDefault')]"
23+
"value": "[variables('apiVersionCompute')]"
2424
},
2525
"targetVMName": {
2626
"value": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET))]"

extensions/hello-world-k8s/v1/template-link.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), 'HelloWorldK8s')]",
33
"type": "Microsoft.Resources/deployments",
4-
"apiVersion": "[variables('apiVersionLinkDefault')]",
4+
"apiVersion": "[variables('apiVersionCompute')]",
55
"dependsOn": [
66
"[concat('Microsoft.Compute/virtualMachines/', EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), '/extensions/cse', '-EXTENSION_TARGET_VM_TYPE-', copyIndex(EXTENSION_LOOP_OFFSET))]"
77
],
@@ -20,7 +20,7 @@
2020
"value": "EXTENSION_URL_REPLACE"
2121
},
2222
"apiVersionCompute": {
23-
"value": "[variables('apiVersionDefault')]"
23+
"value": "[variables('apiVersionCompute')]"
2424
},
2525
"targetVMName": {
2626
"value": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET))]"

extensions/microsoft-oms-agent-k8s/v1/template-link.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), 'MicrosoftOMSAgentk8s')]",
33
"type": "Microsoft.Resources/deployments",
4-
"apiVersion": "[variables('apiVersionLinkDefault')]",
4+
"apiVersion": "[variables('apiVersionCompute')]",
55
"dependsOn": [
66
"[concat('Microsoft.Compute/virtualMachines/', EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), '/extensions/cse', '-EXTENSION_TARGET_VM_TYPE-', copyIndex(EXTENSION_LOOP_OFFSET))]"
77
],
@@ -19,8 +19,8 @@
1919
"artifactsLocation": {
2020
"value": "EXTENSION_URL_REPLACE"
2121
},
22-
"apiVersionDefault": {
23-
"value": "[variables('apiVersionDefault')]"
22+
"apiVersionCompute": {
23+
"value": "[variables('apiVersionCompute')]"
2424
},
2525
"targetVMName": {
2626
"value": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET))]"

extensions/microsoft-oms-agent-k8s/v1/template.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"description": "Artifacts Location - URL"
1010
}
1111
},
12-
"apiVersionDefault": {
12+
"apiVersionCompute": {
1313
"type": "string",
1414
"minLength": 1,
1515
"metadata": {
@@ -50,7 +50,7 @@
5050
},
5151
"resources": [
5252
{
53-
"apiVersion": "[parameters('apiVersionDefault')]",
53+
"apiVersion": "[parameters('apiVersionCompute')]",
5454
"dependsOn": [],
5555
"location": "[resourceGroup().location]",
5656
"type": "Microsoft.Compute/virtualMachines/extensions",

extensions/prometheus-grafana-k8s/v1/template-link.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), 'PrometheusGrafanaK8s')]",
33
"type": "Microsoft.Resources/deployments",
4-
"apiVersion": "[variables('apiVersionLinkDefault')]",
4+
"apiVersion": "[variables('apiVersionComput')]",
55
"dependsOn": [
66
"[concat('Microsoft.Compute/virtualMachines/', EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), '/extensions/cse', '-EXTENSION_TARGET_VM_TYPE-', copyIndex(EXTENSION_LOOP_OFFSET))]"
77
],
@@ -20,7 +20,7 @@
2020
"value": "EXTENSION_URL_REPLACE"
2121
},
2222
"apiVersionCompute": {
23-
"value": "[variables('apiVersionDefault')]"
23+
"value": "[variables('apiVersionCompute')]"
2424
},
2525
"targetVMName": {
2626
"value": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET))]"

extensions/windows-patches/v1/template-link.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), 'windows-patches')]",
33
"type": "Microsoft.Resources/deployments",
4-
"apiVersion": "[variables('apiVersionLinkDefault')]",
4+
"apiVersion": "[variables('apiVersionCompute')]",
55
"dependsOn": [
66
"[concat('Microsoft.Compute/virtualMachines/', EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), '/extensions/cse', '-EXTENSION_TARGET_VM_TYPE-', copyIndex(EXTENSION_LOOP_OFFSET))]"
77
],
@@ -20,7 +20,7 @@
2020
"value": "EXTENSION_URL_REPLACE"
2121
},
2222
"apiVersionCompute": {
23-
"value": "[variables('apiVersionDefault')]"
23+
"value": "[variables('apiVersionCompute')]"
2424
},
2525
"targetVMName": {
2626
"value": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET))]"

extensions/winrm/v1/template-link.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), 'winrm')]",
33
"type": "Microsoft.Resources/deployments",
4-
"apiVersion": "[variables('apiVersionLinkDefault')]",
4+
"apiVersion": "[variables('apiVersionCompute')]",
55
"dependsOn": [
66
"[concat('Microsoft.Compute/virtualMachines/', EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), '/extensions/cse', '-EXTENSION_TARGET_VM_TYPE-', copyIndex(EXTENSION_LOOP_OFFSET))]"
77
],
@@ -20,7 +20,7 @@
2020
"value": "EXTENSION_URL_REPLACE"
2121
},
2222
"apiVersionCompute": {
23-
"value": "[variables('apiVersionDefault')]"
23+
"value": "[variables('apiVersionCompute')]"
2424
},
2525
"targetVMName": {
2626
"value": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET))]"

parts/k8s/kubernetesagentresourcesvmas.t

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{
2-
{{if .AcceleratedNetworkingEnabled}}
3-
"apiVersion": "2018-04-01",
4-
{{else}}
5-
"apiVersion": "[variables('apiVersionDefault')]",
6-
{{end}}
2+
"apiVersion": "[variables('apiVersionNetwork')]",
73
"copy": {
84
"count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]",
95
"name": "loop"
@@ -84,14 +80,15 @@
8480
{
8581
"location": "[variables('location')]",
8682
"name": "[variables('{{.Name}}AvailabilitySet')]",
87-
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
83+
"apiVersion": "[variables('apiVersionCompute')]",
8884
"properties":
8985
{
9086
"platformFaultDomainCount": 2,
91-
"platformUpdateDomainCount": 3,
92-
"managed" : "true"
87+
"platformUpdateDomainCount": 3
9388
},
94-
89+
"sku": {
90+
"name": "Aligned"
91+
},
9592
"type": "Microsoft.Compute/availabilitySets"
9693
},
9794
{{else if .IsStorageAccount}}
@@ -110,8 +107,8 @@
110107
{{end}}
111108
"location": "[variables('location')]",
112109
"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'))]",
113-
"properties": {
114-
"accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
110+
"sku": {
111+
"name": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
115112
},
116113
"type": "Microsoft.Storage/storageAccounts"
117114
},
@@ -131,30 +128,22 @@
131128
{{end}}
132129
"location": "[variables('location')]",
133130
"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'))]",
134-
"properties": {
135-
"accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
131+
"sku": {
132+
"name": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
136133
},
137134
"type": "Microsoft.Storage/storageAccounts"
138135
},
139136
{{end}}
140137
{
141138
"location": "[variables('location')]",
142139
"name": "[variables('{{.Name}}AvailabilitySet')]",
143-
"apiVersion": "[variables('apiVersionDefault')]",
140+
"apiVersion": "[variables('apiVersionCompute')]",
144141
"properties": {},
145142
"type": "Microsoft.Compute/availabilitySets"
146143
},
147144
{{end}}
148145
{
149-
{{if UserAssignedIDEnabled}}
150-
"apiVersion": "[variables('apiVersionUserMSI')]",
151-
{{else}}
152-
{{if .IsManagedDisks}}
153-
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
154-
{{else}}
155-
"apiVersion": "[variables('apiVersionDefault')]",
156-
{{end}}
157-
{{end}}
146+
"apiVersion": "[variables('apiVersionCompute')]",
158147
"copy": {
159148
"count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]",
160149
"name": "vmLoopNode"
@@ -271,7 +260,7 @@
271260
{{if UseManagedIdentity}}
272261
{{if (not UserAssignedIDEnabled)}}
273262
{
274-
"apiVersion": "2014-10-01-preview",
263+
"apiVersion": "[variables('apiVersionCompute')]",
275264
"copy": {
276265
"count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]",
277266
"name": "vmLoopNode"
@@ -291,7 +280,7 @@
291280
"count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]",
292281
"name": "vmLoopNode"
293282
},
294-
"apiVersion": "2015-05-01-preview",
283+
"apiVersion": "[variables('apiVersionCompute')]",
295284
"location": "[resourceGroup().location]",
296285
{{if UserAssignedIDEnabled}}
297286
"dependsOn": [
@@ -316,7 +305,7 @@
316305
},
317306
{{end}}
318307
{
319-
"apiVersion": "[variables('apiVersionDefault')]",
308+
"apiVersion": "[variables('apiVersionCompute')]",
320309
"copy": {
321310
"count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]",
322311
"name": "vmLoopNode"
@@ -350,7 +339,7 @@
350339
,{
351340
"type": "Microsoft.Compute/virtualMachines/extensions",
352341
"name": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')), '/computeAksLinuxBilling')]",
353-
"apiVersion": "[variables('apiVersionDefault')]",
342+
"apiVersion": "[variables('apiVersionCompute')]",
354343
"copy": {
355344
"count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]",
356345
"name": "vmLoopNode"

0 commit comments

Comments
 (0)