-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
task.json
416 lines (416 loc) · 17.5 KB
/
task.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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
{
"id": "CBC316A2-586F-4DEF-BE79-488A1F503564",
"name": "Kubernetes",
"friendlyName": "Deploy to Kubernetes",
"description": "Deploy, configure, update your Kubernetes cluster in Azure Container Service by running kubectl commands.",
"helpMarkDown": "[More Information](https://go.microsoft.com/fwlink/?linkid=851275)",
"category": "Deploy",
"visibility": [
"Build",
"Release"
],
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 0,
"Patch": 4
},
"demands": [],
"preview": "true",
"releaseNotes": "What's new in Version 1.0:<br/> Added new service connection type input for easy selection of Azure AKS cluster.<br/> Replaced output variable input with output variables section that we had added in all tasks.",
"groups": [
{
"name": "commands",
"displayName": "Commands",
"isExpanded": true
},
{
"name": "secrets",
"displayName": "Secrets",
"isExpanded": false
},
{
"name": "configMaps",
"displayName": "ConfigMaps",
"isExpanded": false
},
{
"name": "advanced",
"displayName": "Advanced",
"isExpanded": false
},
{
"name": "output",
"displayName": "Output",
"isExpanded": false
}
],
"inputs": [
{
"name": "connectionType",
"type": "pickList",
"label": "Service connection type",
"defaultValue": "Azure Resource Manager",
"required": true,
"options": {
"Azure Resource Manager": "Azure Resource Manager",
"Kubernetes Service Connection": "Kubernetes Service Connection"
},
"helpMarkDown": "Select a service connection type."
},
{
"name": "kubernetesServiceEndpoint",
"type": "connectedService:kubernetes",
"label": "Kubernetes service connection",
"visibleRule": "connectionType = Kubernetes Service Connection",
"helpMarkDown": "Select a Kubernetes service connection.",
"required": true
},
{
"name": "azureSubscriptionEndpoint",
"type": "connectedService:AzureRM",
"label": "Azure subscription",
"helpMarkDown": "Select the Azure Resource Manager subscription, which contains Azure Container Registry.Note: To configure new service connection, select the Azure subscription from the list and click 'Authorize'. If your subscription is not listed or if you want to use an existing Service Principal, you can setup an Azure service connection using 'Add' or 'Manage' button.",
"visibleRule": "connectionType = Azure Resource Manager",
"defaultValue": "",
"required": true
},
{
"name": "azureResourceGroup",
"label": "Resource group",
"type": "pickList",
"helpMarkDown": "Select an Azure resource group.",
"visibleRule": "connectionType = Azure Resource Manager",
"defaultValue": "",
"required": true,
"properties": {
"EditableOptions": "True"
}
},
{
"name": "kubernetesCluster",
"label": "Kubernetes cluster",
"type": "pickList",
"helpMarkDown": "Select an Azure managed cluster.",
"visibleRule": "connectionType = Azure Resource Manager",
"defaultValue": "",
"required": true,
"properties": {
"EditableOptions": "True"
}
},
{
"name": "namespace",
"type": "string",
"label": "Namespace",
"required": false,
"defaultValue": "",
"helpMarkDown": "Set the namespace for the kubectl command by using the –namespace flag. If the namespace is not provided, the commands will run in the default namespace."
},
{
"name": "command",
"type": "pickList",
"label": "Command",
"defaultValue": "apply",
"required": true,
"options": {
"apply": "apply",
"create": "create",
"delete": "delete",
"exec": "exec",
"expose": "expose",
"get": "get",
"logs": "logs",
"run": "run",
"set": "set",
"top": "top"
},
"helpMarkDown": "Select or specify a kubectl command to run.",
"groupName": "commands",
"properties": {
"EditableOptions": "True"
}
},
{
"name": "useConfigurationFile",
"type": "boolean",
"label": "Use configuration files",
"defaultValue": "false",
"helpMarkDown": "Use Kubernetes configuration file with the kubectl command. Filename, directory, or URL to Kubernetes configuration files can also be provided.",
"groupName": "commands"
},
{
"name": "configuration",
"type": "filePath",
"label": "Configuration file",
"defaultValue": "",
"required": true,
"helpMarkDown": "Filename, directory, or URL to kubernetes configuration files that will be used with the commands.",
"visibleRule": "useConfigurationFile = true",
"groupName": "commands"
},
{
"name": "arguments",
"type": "multiLine",
"properties": {
"resizable": "true",
"rows": "2",
"editorExtension": "ms.vss-services-azure.parameters-grid"
},
"label": "Arguments",
"helpMarkDown": "Arguments to the specified kubectl command.",
"groupName": "commands"
},
{
"name": "secretType",
"type": "pickList",
"label": "Type of secret",
"defaultValue": "dockerRegistry",
"required": true,
"options": {
"dockerRegistry": "dockerRegistry",
"generic": "generic"
},
"helpMarkDown": "Create/update a generic or dockerimagepullsecret.",
"groupName": "secrets"
},
{
"name": "secretArguments",
"type": "multiLine",
"properties": {
"resizable": "true",
"rows": "2",
"editorExtension": "ms.vss-services-azure.kubernetes-parameters-grid"
},
"label": "Arguments",
"defaultValue":"",
"helpMarkDown": "Specify keys and literal values to insert in secret.For example, --from-literal=key1=value1 --from-literal=key2=\"top secret\".",
"visibleRule": "secretType = generic",
"groupName": "secrets"
},
{
"name": "containerRegistryType",
"type": "pickList",
"label": "Container registry type",
"defaultValue": "Azure Container Registry",
"required": true,
"options": {
"Azure Container Registry": "Azure Container Registry",
"Container Registry": "Container Registry"
},
"helpMarkDown": "Select a Container registry type. The task can use Azure Subscription details to work with an Azure Container registry. Other standard Container registries are also supported.",
"visibleRule": "secretType = dockerRegistry",
"groupName": "secrets"
},
{
"name": "dockerRegistryEndpoint",
"type": "connectedService:dockerregistry",
"label": "Docker registry service connection",
"helpMarkDown": "Select a Docker registry service connection. Required for commands that need to authenticate with a registry.",
"visibleRule": "secretType = dockerRegistry && containerRegistryType = Container Registry",
"groupName": "secrets"
},
{
"name": "azureSubscriptionEndpointForSecrets",
"type": "connectedService:AzureRM",
"label": "Azure subscription",
"helpMarkDown": "Select the Azure Resource Manager subscription, which contains Azure Container Registry. Note: To configure new service connection, select the Azure subscription from the list and click 'Authorize'. If your subscription is not listed or if you want to use an existing Service Principal, you can setup an Azure service connection using 'Add' or 'Manage' button.",
"visibleRule": "secretType = dockerRegistry && containerRegistryType = Azure Container Registry",
"defaultValue": "",
"groupName": "secrets"
},
{
"name": "azureContainerRegistry",
"label": "Azure container registry",
"type": "pickList",
"helpMarkDown": "Select an Azure Container Registry which will be used for pulling container images and deploying applications to the Kubernetes cluster. Required for commands that need to authenticate with a registry.",
"visibleRule": "secretType = dockerRegistry && containerRegistryType = Azure Container Registry",
"defaultValue": "",
"groupName": "secrets"
},
{
"name": "secretName",
"type": "string",
"label": "Secret name",
"required": false,
"defaultValue": "",
"helpMarkDown": "Name of the secret. You can use this secret name in the Kubernetes YAML configuration file.",
"groupName": "secrets"
},
{
"name": "forceUpdate",
"type": "boolean",
"label": "Force update secret",
"defaultValue": "true",
"helpMarkDown": "Delete the secret if it exists and create a new one with updated values.",
"groupName": "secrets"
},
{
"name": "configMapName",
"type": "string",
"label": "ConfigMap name",
"defaultValue": "",
"helpMarkDown": "ConfigMaps allow you to decouple configuration artifacts from image content to keep containerized applications portable.",
"groupName": "configMaps"
},
{
"name": "forceUpdateConfigMap",
"type": "boolean",
"label": "Force update configmap",
"defaultValue": "false",
"helpMarkDown": "Delete the configmap if it exists and create a new one with updated values.",
"groupName": "configMaps"
},
{
"name": "useConfigMapFile",
"type": "boolean",
"label": "Use file",
"defaultValue": "false",
"helpMarkDown": "Create a ConfigMap from an individual file, or from multiple files by specifying a directory.",
"groupName": "configMaps"
},
{
"name": "configMapFile",
"type": "filePath",
"label": "ConfigMap file",
"defaultValue": "",
"required": true,
"helpMarkDown": "Specify a file or directory that contains the configMaps",
"visibleRule": "useConfigMapFile = true",
"groupName": "configMaps"
},
{
"name": "configMapArguments",
"type": "multiLine",
"properties": {
"resizable": "true",
"rows": "2",
"editorExtension": "ms.vss-services-azure.kubernetes-parameters-grid"
},
"label": "Arguments",
"helpMarkDown": "Specify keys and literal values to insert in configMap.For example, --from-literal=key1=value1 --from-literal=key2=\"top secret\".",
"visibleRule": "useConfigMapFile = false",
"groupName": "configMaps"
},
{
"name": "versionOrLocation",
"type": "radio",
"label": "Kubectl",
"defaultValue": "version",
"required": false,
"options": {
"version": "Version",
"location": "Specify location"
},
"groupName": "advanced"
},
{
"name": "versionSpec",
"type": "string",
"label": "Version spec",
"defaultValue": "1.7.0",
"helpMarkDown": "Version Spec of version to get. Examples: 1.7.0, 1.x.0, 4.x.0, 6.10.0, >=6.10.0",
"groupName": "advanced",
"visibleRule": "versionOrLocation = version"
},
{
"name": "checkLatest",
"type": "boolean",
"label": "Check for latest version",
"defaultValue": "false",
"helpMarkDown": "Always checks online for the latest available version (stable.txt) that satisfies the version spec. This is typically false unless you have a specific scenario to always get latest. This will cause it to incur download costs when potentially not necessary, especially with the hosted build pool.",
"required": false,
"groupName": "advanced",
"visibleRule": "versionOrLocation = version"
},
{
"name": "specifyLocation",
"type": "filePath",
"label": "Path to kubectl",
"defaultValue": "",
"helpMarkDown": "Full path to the kubectl.exe",
"required": true,
"groupName": "advanced",
"visibleRule": "versionOrLocation = location"
},
{
"name": "cwd",
"aliases": ["workingDirectory"],
"type": "filePath",
"label": "Working directory",
"defaultValue": "$(System.DefaultWorkingDirectory)",
"helpMarkDown": "Working directory for the Kubectl command.",
"groupName": "advanced"
},
{
"name": "outputFormat",
"type": "pickList",
"label": "Output format",
"defaultValue": "json",
"required": false,
"options": {
"json": "json",
"yaml": "yaml"
},
"helpMarkDown": "Output format.",
"groupName": "advanced",
"properties": {
"EditableOptions": "True"
}
}
],
"dataSourceBindings": [
{
"target": "azureContainerRegistry",
"endpointId": "$(azureSubscriptionEndpoint2)",
"dataSourceName": "AzureRMContainerRegistries",
"resultTemplate": "{\"Value\":\"{{{properties.loginServer}}}\",\"DisplayValue\":\"{{{name}}}\"}"
},
{
"target": "kubernetesCluster",
"endpointId": "$(azureSubscriptionEndpoint)",
"endpointUrl":"{{{endpoint.url}}}/subscriptions/{{{endpoint.subscriptionId}}}/resourceGroups/$(azureResourceGroup)/providers/Microsoft.ContainerService/managedClusters?api-version=2017-08-31",
"resultSelector": "jsonpath:$.value[*]",
"resultTemplate": "{{{name}}}"
},
{
"target": "azureResourceGroup",
"endpointId": "$(azureSubscriptionEndpoint)",
"endpointUrl":"{{{endpoint.url}}}/subscriptions/{{{endpoint.subscriptionId}}}/providers/Microsoft.ContainerService/managedClusters?api-version=2017-08-31",
"resultSelector": "jsonpath:$.value[*]",
"resultTemplate": "{{{ #extractResource id resourcegroups}}}"
}
],
"instanceNameFormat": "kubectl $(command)",
"outputVariables": [
{
"name" : "KubectlOutput",
"description": "Stores the output of the kubectl command"
}
],
"execution": {
"Node": {
"target": "src//kubernetes.js"
}
},
"messages": {
"CantDownloadAccessProfile": "Cannot download access profile/kube config file for the cluster %s. Reason %s.",
"DownloadingClient": "Downloading kubernetes client.",
"KubernetesClusterResourceGroup" : "Kubernetes cluster %s, resource group %s.",
"CreatingSecret": "Executing create %s secret.",
"DeleteSecret": "Executing delete %s secret",
"CreatingConfigMap": "Executing create %s configmap.",
"DeleteConfigMap": "Executing delete %s configmap",
"ConfigMapExists": "ConfigMap %s already exists",
"GetConfigMap": "Executing get %s configmap",
"DockerRegistryConnectionNotSpecified": "Docker Registry service connection details not specified",
"FileNotFoundException": "Can not find file at location: %s",
"DownloadingKubeCtlFromUrl": "Downloading Kubectl from URL: %s",
"DownloadPathForStableTxt": "Download path for stable.txt: %s",
"DownloadKubeCtlFailed": "Can not download the kubectl client of version %s. Check if the version is correct https://github.com/kubernetes/kubernetes/releases",
"DownloadStableVersionFailed": "Can not download kubernetes stable version file from %s. Falling back to %s",
"UsingLatestStableVersion": "Invalid version 1.7 specified in Version Spec input. Using latest stable version instead. Check for correct versions https://github.com/kubernetes/kubernetes/releases",
"NotAValidSemverVersion": "Version not specified in correct format. E.g: 1.8.2, v1.8.2, 2.8.2, v2.8.2.",
"ConfigurationFileNotFound":"No configuration file matching %s was found."
}
}