Azure Kubernetes Service (AKS) is a managed Kubernetes service that lets you quickly deploy and manage clusters. In this quickstart, you will:
- Deploy an AKS cluster using the Azure CLI.
- Run a sample multi-container application with a web front-end and a Redis instance in the cluster.
You can use either the Azure Cloud Shell or a local Azure CLI.
- Azure Cloud Shell with the Bash environment. Or launch the Cloud Shell here.
- Local Azure CLI, see how to install the Azure CLI. If you’re running on Windows or macOS, consider running Azure CLI in a Docker container. For more information, see How to run the Azure CLI in a Docker container.
- Sign in to the Azure CLI by using the az login command. To finish the authentication process, follow the steps displayed in your terminal. For other sign-in options, see Sign in with the Azure CLI.
- When you first use Azure CLI, install the Azure CLI extension. For more information about extensions, see Use extensions with the Azure CLI.
- Run az version to find the version and dependent libraries that are installed. To upgrade to the latest version, run az upgrade.
- This article requires version 2.0.64 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
- The identity you are using to create your cluster has the appropriate minimum permissions. For more details on access and identity for AKS, see Access and identity options for Azure Kubernetes Service (AKS).
- If you have multiple Azure subscriptions, select the appropriate subscription ID in which the resources should be billed using the az account command.
Connect to AKS cluster
Make sure you have Azure CLI installed on your working machine, open terminal and connect to the Azure Cloud with command:
az login -t <your Azure AD directory ID>
Set default subscription if you have multiple subscription in the Azure Cloud, this subscription must contains your AKS cluster.
az account set -s <your aks cluster's subscriptions>
And get AKS context with command
az aks get-credentials -n <your aks name> -g <your aks resource group>
After getting the AKS context, you can easily switch your kubectl to start working with your AKS cluster with
kubectl config use-context <your aks name. as k8s context>