-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Copy pathtask.json
494 lines (494 loc) · 19.3 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
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
{
"id": "CBC316A2-586F-4DEF-BE79-488A1F503564",
"name": "Kubernetes",
"friendlyName": "Kubectl",
"description": "Deploy, configure, update a Kubernetes cluster in Azure Container Service by running kubectl commands",
"helpUrl": "https://aka.ms/azpipes-kubectl-tsg",
"helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?linkid=851275) or [see the Kubernetes documentation](https://kubernetes.io/docs/home/)",
"category": "Deploy",
"visibility": [
"Build",
"Release"
],
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 250,
"Patch": 0
},
"demands": [],
"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": "kubernetesCluster",
"displayName": "Kubernetes Cluster",
"isExpanded": true,
"visibleRule": "command != logout"
},
{
"name": "commands",
"displayName": "Commands",
"isExpanded": true
},
{
"name": "secrets",
"displayName": "Secrets",
"isExpanded": false,
"visibleRule": "command != login && command != logout"
},
{
"name": "configMaps",
"displayName": "ConfigMaps",
"isExpanded": false,
"visibleRule": "command != login && command != logout"
},
{
"name": "advanced",
"displayName": "Advanced",
"isExpanded": false
},
{
"name": "output",
"displayName": "Output",
"isExpanded": false,
"visibleRule": "command != login && command != logout"
}
],
"inputs": [
{
"name": "connectionType",
"type": "pickList",
"label": "Service connection type",
"defaultValue": "Kubernetes Service Connection",
"required": true,
"options": {
"Azure Resource Manager": "Azure Resource Manager",
"Kubernetes Service Connection": "Kubernetes Service Connection",
"None": "None"
},
"groupName": "kubernetesCluster",
"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.",
"groupName": "kubernetesCluster",
"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": "",
"groupName": "kubernetesCluster",
"required": true
},
{
"name": "azureResourceGroup",
"label": "Resource group",
"type": "pickList",
"helpMarkDown": "Select an Azure resource group.",
"visibleRule": "connectionType = Azure Resource Manager",
"defaultValue": "",
"required": true,
"groupName": "kubernetesCluster",
"properties": {
"EditableOptions": "True"
}
},
{
"name": "kubernetesCluster",
"label": "Kubernetes cluster",
"type": "pickList",
"helpMarkDown": "Select an Azure managed cluster.",
"visibleRule": "connectionType = Azure Resource Manager",
"defaultValue": "",
"required": true,
"groupName": "kubernetesCluster",
"properties": {
"EditableOptions": "True"
}
},
{
"name": "useClusterAdmin",
"type": "boolean",
"label": "Use cluster admin credentials",
"defaultValue": "false",
"visibleRule": "connectionType = Azure Resource Manager",
"groupName": "kubernetesCluster",
"helpMarkDown": "Use cluster administrator credentials instead of default cluster user credentials."
},
{
"name": "namespace",
"type": "string",
"label": "Namespace",
"required": false,
"defaultValue": "",
"groupName": "kubernetesCluster",
"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": "",
"required": false,
"options": {
"apply": "apply",
"create": "create",
"delete": "delete",
"exec": "exec",
"expose": "expose",
"get": "get",
"login": "login",
"logout": "logout",
"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",
"defaultValue": "false",
"helpMarkDown": "Use Kubernetes configuration with the kubectl command. An inline script, filename, directory, or URL to Kubernetes configuration files can be provided.",
"groupName": "commands",
"visibleRule": "command != login && command != logout"
},
{
"name": "configurationType",
"type": "radio",
"label": "Configuration type",
"defaultValue": "configuration",
"groupName": "commands",
"helpMarkDown": "Type of Kubernetes configuration for kubectl command. It can be a file path or an inline script.",
"options": {
"configuration": "File path",
"inline": "Inline configuration"
},
"visibleRule": "useConfigurationFile = true"
},
{
"name": "configuration",
"type": "filePath",
"label": "File path",
"defaultValue": "",
"required": true,
"helpMarkDown": "Filename, directory, or URL to kubernetes configuration files that will be used with the commands.",
"visibleRule": "configurationType = configuration",
"groupName": "commands"
},
{
"name": "inline",
"type": "multiLine",
"properties": {
"resizable": "true",
"rows": "10",
"maxLength": "5000"
},
"required": true,
"defaultValue": "",
"label": "Inline configuration",
"helpMarkDown": "Inline deployment configuration for kubectl command",
"groupName": "commands",
"visibleRule": "configurationType = inline"
},
{
"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",
"visibleRule": "command != login && command != logout"
},
{
"name": "secretType",
"type": "pickList",
"label": "Type of secret",
"defaultValue": "dockerRegistry",
"required": true,
"options": {
"dockerRegistry": "dockerRegistry",
"generic": "generic"
},
"helpMarkDown": "Create/update a generic or docker imagepullsecret. Select dockerRegistry to create/update the imagepullsecret of the selected registry. An imagePullSecret is a way to pass a secret that contains a container registry password to the Kubelet so it can pull a private image on behalf of your Pod.",
"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"
},
"helpMarkDown": "kubectl is a command line interface for running commands against Kubernetes clusters.",
"groupName": "advanced"
},
{
"name": "versionSpec",
"type": "string",
"label": "Version spec",
"defaultValue": "1.13.2",
"helpMarkDown": "Version Spec of version to get. Examples: 1.7.0, 1.x.0, 4.x.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",
"none": "none"
},
"helpMarkDown": "Output format.",
"groupName": "advanced",
"properties": {
"EditableOptions": "True"
}
}
],
"dataSourceBindings": [
{
"target": "azureContainerRegistry",
"endpointId": "$(azureSubscriptionEndpointForSecrets)",
"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": {
"Node16": {
"target": "src//kubernetes.js"
},
"Node10": {
"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",
"NotAValidVersion": "Not a valid version, the available versions are: %s",
"ConfigurationFileNotFound": "No configuration file matching %s was found.",
"KubernetesServiceConnectionNotFound": "Kubernetes service connection details not found.",
"OutputVariableDataSizeExceeded": "Output variable not set as kubectl command output exceeded the maximum supported length. Output length: %s, Maximum supported length: %s",
"InvalidConfiguration": "No Kubernetes configuration found, supply either inline configuration or configuration file path",
"CallToolRunnerExec": "Calling Toolrunner exec() method asynchronously to execute the kubectl command and store the returned promise object.",
"ReturningToolRunnerExecPromise": "Called Toolrunner exec() method asynchronously. Returning the promise.",
"ToolRunnerExecCallFailed": "Toolrunner exec() method returned error for the kubectl command. Error: %s.",
"ToolRunnerExecCallSucceeded": "Toolrunner exec() method returned successfully for the kubectl command.",
"WritingDockerConfigToTempFile": "Writing Docker config to temp file. File path: %s, Docker config: %s",
"ExpiredServicePrincipal": "Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired.",
"UnableToFetchKubectlVersion": "Could not fetch Kubectl version. Please make sure that the Kubernetes server is up and running.",
"KubectlClientVersion": "Kubectl Client Version",
"KubectlServerVersion": "Kubectl Server Version",
"KubectlServerVerisonNotFound": "Could not find kubectl server version",
"KubeloginFailed": "Kubelogin authentication failed. Exception: %s"
}
}