az aks

Manage Kubernetes clusters.

Commands

az aks browse Open a web browser to the dashboard for a managed Kubernetes cluster.
az aks create Create a new Azure managed Kubernetes cluster.
az aks delete Delete a managed Kubernetes cluster.
az aks get-credentials Get credentials to access a managed Kubernetes cluster.
az aks get-versions Get versions available to upgrade a managed Kubernetes cluster.
az aks install-cli Download and install kubectl, the Kubernetes command line tool.
az aks install-connector Deploy the ACI-Connector to a AKS cluster.
az aks list List managed Kubernetes clusters.
az aks remove-connector Undeploy the ACI-Connector from an AKS cluster.
az aks scale Scale the node pool in a managed Kubernetes cluster.
az aks show Show a managed Kubernetes cluster.
az aks upgrade Upgrade a managed Kubernetes cluster to a newer version.
az aks wait Wait for a Kubernetes cluster to reach a desired state.

az aks browse

Open a web browser to the dashboard for a managed Kubernetes cluster.

az aks browse --name
--resource-group
[--disable-browser]

Required Parameters

--name -n

Resource name for the managed cluster.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--disable-browser

If true, don't launch a web browser after establishing the kubectl port-forward.

az aks create

Create a new Azure managed Kubernetes cluster.

az aks create --name
--resource-group
[--admin-username]
[--client-secret]
[--dns-name-prefix]
[--generate-ssh-keys]
[--kubernetes-version]
[--location]
[--no-wait]
[--node-count]
[--node-osdisk-size]
[--node-vm-size]
[--service-principal]
[--ssh-key-value]
[--tags]

Examples

Create a Kubernetes cluster.

az aks create -g MyResourceGroup -n MyManagedCluster

Create a Kubernetes cluster with a an existing SSH key.

az aks create -g MyResourceGroup -n MyManagedCluster --ssh-key-value /path/to/publickey

Create a Kubernetes cluster with a specific version

az aks create -g MyResourceGroup -n MyManagedCluster --kubernetes-version 1.8.1

Create a Kubernetes cluster with a larger node pool count

az aks create -g MyResourceGroup -n MyManagedCluster --node-count 7

Required Parameters

--name -n

Resource name for the managed cluster.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--admin-username -u

User name for the Linux Virtual Machines.

default value: azureuser
--client-secret

The secret associated with the service principal. If --service-principal is specified, then secret should also be specified. If --service-principal is not specified, the secret is auto-generated for you and stored in ${HOME}/.azure/ directory.

--dns-name-prefix -p
--generate-ssh-keys

Generate SSH public and private key files if missing.

--kubernetes-version -k

The version of Kubernetes to use for creating the cluster, such as '1.7.9' or '1.8.2'.

default value: 1.7.7
--location -l

Location. You can configure the default location using az configure --defaults location=<location>.

--no-wait

Do not wait for the long-running operation to finish.

--node-count -c

The default number of nodes for the node pools.

default value: 3
--node-osdisk-size

The osDisk size in GB of node pool Virtual Machine.

--node-vm-size -s

The size of the Virtual Machine.

default value: Standard_D1_v2
--service-principal

The service principal used for cluster authentication to Azure APIs. If not specified, it is created for you and stored in the ${HOME}/.azure directory.

--ssh-key-value

SSH key file value or key file path.

default value: ~.sshid_rsa.pub
--tags

Space separated tags in 'key[=value]' format. Use "" to clear existing tags.

az aks delete

Delete a managed Kubernetes cluster.

az aks delete --name
--resource-group
[--no-wait]
[--yes]

Required Parameters

--name -n

Resource name for the managed cluster.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

--yes -y

Do not prompt for confirmation.

az aks get-credentials

Get credentials to access a managed Kubernetes cluster.

az aks get-credentials --name
--resource-group
[--admin]
[--file]

Required Parameters

--name -n

Resource name for the managed cluster.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--admin -a

Get the "clusterAdmin" kubectl config instead of the default "clusterUser".

--file -f

A kubectl config file to create or update. Use "-" to print YAML to stdout instead.

default value: C:Usersappveyor.kubeconfig

az aks get-versions

Get versions available to upgrade a managed Kubernetes cluster.

az aks get-versions --name
--resource-group

Required Parameters

--name -n

Resource name for the managed cluster.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az aks install-cli

Download and install kubectl, the Kubernetes command line tool.

az aks install-cli [--client-version]
[--install-location]

Optional Parameters

--client-version
default value: latest
--install-location
default value: C:Program Files (x86)kubectl.exe

az aks install-connector

Deploy the ACI-Connector to a AKS cluster.

az aks install-connector --connector-name
--name
--resource-group
[--chart-url]
[--client-secret]
[--location]
[--os-type {Both, Linux, Windows}]
[--service-principal]

Examples

Install the ACI-Connector to an AKS Cluster.

az aks install-connector --name MyManagedCluster --resource-group MyResourceGroup --connector-name aci-connector

Install the ACI-Connector for Windows to an AKS Cluster.

az aks install-connector --name MyManagedCluster --resource-group MyResourceGroup --connector-name aci-connector --os-type Windows

Install the ACI-Connector for Windows and Linux to an AKS Cluster.

az aks install-connector --name MyManagedCluster --resource-group MyResourceGroup --connector-name aci-connector --os-type Both

Install the ACI-Connector using specific SPN.

az aks install-connector --name MyManagedCluster --resource-group MyResourceGroup --connector-name aci-connector --service-principal <SPN_ID> --client-secret <SPN_SECRET>

Install the ACI-Connector from a specific custom chart.

az aks install-connector --name MyManagedCluster --resource-group MyResourceGroup --connector-name aci-connector --chart-url <CustomURL>

Required Parameters

--connector-name

The name for the ACI Connector.

--name -n

Resource name for the managed cluster.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--chart-url

URL to the chart.

default value: <a href="https://github.com/virtual-kubelet/virtual-kubelet/raw/master/charts/virtual-kubelet-0.1.0.tgz">https://github.com/virtual-kubelet/virtual-kubelet/raw/master/charts/virtual-kubelet-0.1.0.tgz</a>
--client-secret

Client secret to use with the service principal for making calls to Azure APIs.

--location -l

Location. You can configure the default location using az configure --defaults location=<location>.

--os-type

The OS type of the connector.

accepted values: Both, Linux, Windows
default value: Linux
--service-principal

Service principal for making calls into Azure APIs. If not set, auto generate a new service principal of Contributor role, and save it locally for reusing.

az aks list

List managed Kubernetes clusters.

az aks list [--resource-group]

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az aks remove-connector

Undeploy the ACI-Connector from an AKS cluster.

az aks remove-connector --connector-name
--name
--resource-group
[--graceful]
[--os-type {Both, Linux, Windows}]

Examples

Undeploy the ACI-Connector on an AKS cluster.

az aks remove-connector --name MyManagedCluster --resource-group MyResourceGroup --connector-name aci-connector

Undeploy the ACI-Connector on an AKS cluster using the graceful mode

az aks remove-connector --name MyManagedCluster --resource-group MyResourceGroup --connector-name aci-connector --graceful

Required Parameters

--connector-name

The name for the ACI Connector.

--name -n

Resource name for the managed cluster.

--resource-group -g

The name of the resource group where the AKS cluster is deployed.

Optional Parameters

--graceful

Mention if you want to drain/uncordon your aci-connector to move your applications.

--os-type

The OS type of the connector.

accepted values: Both, Linux, Windows
default value: Linux

az aks scale

Scale the node pool in a managed Kubernetes cluster.

az aks scale --name
--node-count
--resource-group
[--no-wait]

Required Parameters

--name -n

Resource name for the managed cluster.

--node-count -c

The desired number of nodes.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

az aks show

Show a managed Kubernetes cluster.

az aks show --name
--resource-group

Required Parameters

--name -n

Resource name for the managed cluster.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az aks upgrade

Upgrade a managed Kubernetes cluster to a newer version.

az aks upgrade --kubernetes-version
--name
--resource-group
[--no-wait]
[--yes]

Required Parameters

--kubernetes-version -k

The version of Kubernetes to upgrade the cluster to, such as '1.7.9' or '1.8.2'.

--name -n

Resource name for the managed cluster.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

--yes -y

Do not prompt for confirmation.

az aks wait

Wait for a Kubernetes cluster to reach a desired state.

az aks wait --name
--resource-group
[--created]
[--custom]
[--deleted]
[--exists]
[--interval]
[--timeout]
[--updated]

Required Parameters

--name -n

The name of the managed cluster resource.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

--exists

Wait until the resource exists.

--interval

Polling interval in seconds.

default value: 30
--timeout

Maximum wait in seconds.

default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.