Partager via


Kubernetes@0 - Kubectl v0 task

Use this task to deploy, configure, or update a Kubernetes cluster in Azure Container Service by running kubectl commands.

Inputs

kubernetesServiceConnection - Kubernetes Service Connection
Input alias: kubernetesServiceEndpoint. string.

Select a Kubernetes service connection.


namespace - Namespace
string.

Specifies 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.


command - Command
string. Required. Allowed values: apply, create, delete, exec, expose, get, logs, run, set, top. Default value: apply.

Specifies a kubectl command.


useConfigurationFile - Use Configuration files
boolean. Default value: false.

Use Kubernetes configuration file with the kubectl command. Filename, directory, or URL to Kubernetes configuration files can also be provided.


configuration - Configuration File
string. Required when useConfigurationFile = true.

Specifies the filename, directory, or URL to kubernetes configuration files that is used with the commands.


arguments - Arguments
string.

Specifies the arguments to the specified kubectl command.


containerRegistryType - Container Registry type
string. Required. Allowed values: Azure Container Registry, Container Registry. Default value: Azure Container Registry.

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.


dockerRegistryConnection - Docker Registry Connection
Input alias: dockerRegistryEndpoint. string. Optional. Use when containerRegistryType = Container Registry.

Select a Docker registry service connection. Required for commands that need to authenticate with a registry.


azureSubscription - Azure subscription
Input alias: azureSubscriptionEndpoint. string. Optional. Use when containerRegistryType = Azure Container Registry.

Specifies the Azure Resource Manager subscription, which contains the Azure Container Registry.

Note

To configure a 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 the Add or Manage buttons.


azureContainerRegistry - Azure Container Registry
string. Optional. Use when containerRegistryType = Azure Container Registry.

Specifies an Azure Container Registry which is used for pulling Container images and deploying applications to the Kubernetes cluster. Required for commands that need to authenticate with a registry.


secretName - Secret name
string.

Name of the secret. You can use this secret name in the Kubernetes YAML configuration file.


forceUpdate - Force update secret
boolean. Default value: true.

Delete the secret if it exists and create a new one with updated values.


versionOrLocation - Kubectl
string. Allowed values: version, location (Specify Location). Default value: version.

kubectl is a command line interface for running commands against Kubernetes clusters.


versionSpec - Version Spec
string. Optional. Use when versionOrLocation = version. Default value: 1.7.0.

Specifies the Version Spec of the version to get. Examples: 1.7.0, 1.x.0, 4.x.0, 6.10.0, >=6.10.0.


checkLatest - Check for Latest Version
boolean. Optional. Use when versionOrLocation = version. Default value: false.

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.


specifyLocation - Path to Kubectl
string. Required when versionOrLocation = location.

Specifies the full path to the kubectl.exe file.


workingDirectory - Working directory
Input alias: cwd. string. Default value: $(System.DefaultWorkingDirectory).

Working directory for the Kubectl command.


outputFormat - Output format
string. Allowed values: json, yaml. Default value: json.

Output format.


kubectlOutput - Output variable name
string.

Name of the variable in which output of the command should be saved.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Requirements

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version All supported agent versions.
Task category Deploy