-
Notifications
You must be signed in to change notification settings - Fork 0
/
createUIDefinition.json
307 lines (307 loc) · 10 KB
/
createUIDefinition.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
{
"$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#",
"handler": "Microsoft.Azure.CreateUIDef",
"version": "0.1.2-preview",
"parameters": {
"config": {
"isWizard": false,
"basics": {
"location": {
"label": "Region for new Azure Kubernetes Service (AKS) cluster",
"visible": "[and(equals(basics('clusterType'), 'managedCluster'), basics('createNewCluster'))]",
"allowedValues": [
"eastus",
"eastus2",
"centralus",
"northcentralus",
"westcentralus",
"southcentralus",
"westus",
"westus2",
"westus3",
"canadacentral",
"canadaeast",
"brazilsouth",
"northeurope",
"westeurope",
"uksouth",
"ukwest",
"francecentral",
"francesouth",
"germanywestcentral",
"norwayeast",
"switzerlandnorth",
"swedencentral",
"uaenorth",
"southafricanorth",
"australiaeast",
"australiasoutheast",
"southeastasia",
"eastasia",
"southindia",
"centralindia",
"japaneast",
"japanwest",
"koreacentral",
"koreasouth"
]
},
"resourceGroup": {
"allowExisting": true
}
}
},
"basics": [
{
"name": "clusterInfoBox",
"type": "Microsoft.Common.InfoBox",
"visible": true,
"options": {
"icon": "Info",
"text": "This application can be installed on Azure Kubernetes Service (AKS) clusters or Azure Arc-enabled Kubernetes clusters. To learn more on how to create Azure Arc-enabled Kubernetes cluster resources, click here.",
"uri": "https://learn.microsoft.com/en-us/azure/azure-arc/kubernetes/quickstart-connect-cluster"
}
},
{
"name": "clusterType",
"type": "Microsoft.Common.OptionsGroup",
"label": "Cluster type",
"defaultValue": "Azure Kubernetes Service (AKS) cluster",
"toolTip": "Select the cluster type",
"constraints": {
"allowedValues": [
{
"label": "Azure Kubernetes Service (AKS) cluster",
"value": "managedCluster"
},
{
"label": "Azure Arc-enabled Kubernetes cluster",
"value": "connectedCluster"
}
],
"required": true
},
"visible": true
},
{
"name": "createNewCluster",
"type": "Microsoft.Common.OptionsGroup",
"label": "Create new Azure Kubernetes Service (AKS) Dev cluster?",
"defaultValue": "No",
"toolTip": "Create a new AKS Dev cluster",
"constraints": {
"allowedValues": [
{
"label": "Yes",
"value": true
},
{
"label": "No",
"value": false
}
],
"required": true
},
"visible": "[equals(basics('clusterType'), 'managedCluster')]"
}
],
"steps": [
{
"name": "clusterDetails",
"label": "Cluster Details",
"elements": [
{
"name": "existingAksClusterSection",
"type": "Microsoft.Common.Section",
"elements": [
{
"name": "aksClusterLookupControl",
"type": "Microsoft.Solutions.ArmApiControl",
"request": {
"method": "GET",
"path": "[concat(subscription().id, '/resourcegroups/', resourceGroup().name, '/providers/Microsoft.ContainerService/managedClusters?api-version=2022-03-01')]"
}
},
{
"name": "existingClusterResourceName",
"type": "Microsoft.Common.DropDown",
"label": "AKS Cluster Name",
"toolTip": "AKS Cluster Resource Name",
"constraints": {
"allowedValues": "[map(steps('clusterDetails').existingAksClusterSection.aksClusterLookupControl.value, (item) => parse(concat('{\"label\":\"', item.name, '\",\"value\":\"', item.name, '\"}')))]",
"required": true
}
}
],
"visible": "[and(equals(basics('clusterType'), 'managedCluster'), equals(basics('createNewCluster'), false))]"
},
{
"name": "existingArcConnectedClusterSection",
"type": "Microsoft.Common.Section",
"elements": [
{
"name": "arcConnectedClusterLookupControl",
"type": "Microsoft.Solutions.ArmApiControl",
"request": {
"method": "GET",
"path": "[concat(subscription().id, '/resourcegroups/', resourceGroup().name, '/providers/Microsoft.Kubernetes/connectedClusters?api-version=2022-10-01-preview')]"
}
},
{
"name": "existingClusterResourceName",
"type": "Microsoft.Common.DropDown",
"label": "Azure Arc-enabled Kubernetes cluster",
"toolTip": "Azure Arc-enabled Kubernetes cluster resource name",
"constraints": {
"allowedValues": "[map(steps('clusterDetails').existingArcConnectedClusterSection.arcConnectedClusterLookupControl.value, (item) => parse(concat('{\"label\":\"', item.name, '\",\"value\":\"', item.name, '\"}')))]",
"required": true
}
}
],
"visible": "[equals(basics('clusterType'), 'connectedCluster')]"
},
{
"name": "newAksClusterSection",
"type": "Microsoft.Common.Section",
"elements": [
{
"name": "aksVersionLookupControl",
"type": "Microsoft.Solutions.ArmApiControl",
"request": {
"method": "GET",
"path": "[concat(subscription().id, '/providers/Microsoft.ContainerService/locations/', location(), '/orchestrators?api-version=2019-04-01&resource-type=managedClusters')]"
}
},
{
"name": "newClusterResourceName",
"type": "Microsoft.Common.TextBox",
"label": "Azure Kubernetes Service (AKS) cluster name",
"defaultValue": "",
"toolTip": "Use only allowed characters",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{6,30}$",
"validationMessage": "Only alphanumeric characters are allowed, and the value must be 6-30 characters long."
}
},
{
"name": "kubernetesVersion",
"type": "Microsoft.Common.DropDown",
"label": "Kubernetes version",
"toolTip": "The version of Kubernetes that should be used for this cluster. You will be able to upgrade this version after creating the cluster.",
"constraints": {
"allowedValues": "[map(steps('clusterDetails').newAksClusterSection.aksVersionLookupControl.properties.orchestrators, (item) => parse(concat('{\"label\":\"', item.orchestratorVersion, '\",\"value\":\"', item.orchestratorVersion, '\"}')))]",
"required": true
}
},
{
"name": "vmSize",
"type": "Microsoft.Compute.SizeSelector",
"label": "VM size",
"toolTip": "The size of virtual machine for VM.",
"recommendedSizes": [
"Standard_B4ms",
"Standard_DS2_v2",
"Standard_D4s_v3"
],
"constraints": {
"allowedSizes": [
"Standard_B4ms",
"Standard_DS2_v2",
"Standard_D4s_v3"
],
"excludedSizes": []
},
"osPlatform": "Linux"
},
{
"name": "osSKU",
"type": "Microsoft.Common.DropDown",
"label": "OS SKU",
"toolTip": "The SKU of Linux OS for VM.",
"defaultValue": "AzureLinux",
"constraints": {
"allowedValues": [
{
"label": "Ubuntu",
"value": "Ubuntu"
},
{
"label": "AzureLinux",
"value": "AzureLinux"
}
],
"required": true
}
},
{
"name": "enableAutoScaling",
"type": "Microsoft.Common.CheckBox",
"label": "Enable auto scaling",
"toolTip": "Enable auto scaling",
"defaultValue": true
},
{
"name": "vmCount",
"type": "Microsoft.Common.Slider",
"min": 1,
"max": 10,
"label": "VMCount",
"subLabel": "",
"defaultValue": 1,
"showStepMarkers": false,
"toolTip": "Specify VM count",
"constraints": {
"required": false
},
"visible": true
}
],
"visible": "[and(equals(basics('clusterType'), 'managedCluster'), basics('createNewCluster'))]"
}
]
},
{
"name": "applicationDetails",
"label": "Application Details",
"elements": [
{
"name": "appInfoBox",
"type": "Microsoft.Common.InfoBox",
"visible": true,
"options": {
"icon": "Info",
"text": "Kubernetes applications are deployed as cluster extensions. Click here to learn more.",
"uri": "https://learn.microsoft.com/en-us/azure/azure-arc/kubernetes/conceptual-extensions"
}
},
{
"name": "extensionResourceName",
"type": "Microsoft.Common.TextBox",
"label": "Cluster extension resource name",
"defaultValue": "kubearmor",
"toolTip": "Only lowercase alphanumeric characters are allowed, and the value must be 6-30 characters long.",
"constraints": {
"required": true,
"regex": "^[a-z0-9]{6,30}$",
"validationMessage": "Only lowercase alphanumeric characters are allowed, and the value must be 6-30 characters long."
},
"visible": true
}
]
}
],
"outputs": {
"location": "[location()]",
"clusterType": "[basics('clusterType')]",
"createNewCluster": "[basics('createNewCluster')]",
"clusterResourceName": "[if(equals(basics('clusterType'), 'managedCluster'), if(basics('createNewCluster'), steps('clusterDetails').newAksClusterSection.newClusterResourceName, steps('clusterDetails').existingAksClusterSection.existingClusterResourceName), steps('clusterDetails').existingArcConnectedClusterSection.existingClusterResourceName)]",
"kubernetesVersion": "[steps('clusterDetails').newAksClusterSection.kubernetesVersion]",
"extensionResourceName": "[steps('applicationDetails').extensionResourceName]",
"vmSize": "[steps('clusterDetails').newAksClusterSection.vmSize]",
"osSKU": "[steps('clusterDetails').newAksClusterSection.osSKU]",
"vmEnableAutoScale": "[steps('clusterDetails').newAksClusterSection.enableAutoScaling]",
"vmCount": "[steps('clusterDetails').newAksClusterSection.vmCount]"
}
}
}