Once you've installed, open a new command prompt and login to your Azure account by running the following command:
Once you've installed, open a new terminal and login to your Azure account by running the following command:
Install AKS CLI
Kubernetes is a container orchestration platform. An orchestrator is responsible for running, distributing, scaling, and healing apps comprised of a collection of containers. Azure Kubernetes Service (AKS) provides Kubernetes as a managed service.
Run the following command to install the command-line tools for AKS:
az aks install-cli
Create Azure resources
Create a resource group
A resource group is used to organize a set of resources related to a single app.
Run the following command to create a resource group on the West US region:
az group create --name myMicroserviceResources --location westus
If you want to use a different location on the previous command, you can run the following command to see which regions are available on your account and pick one closer to you:
az account list-locations -o table
Create an AKS cluster
Run the following command to create an AKS cluster in the resource group:
It's normal for this command to take several minutes to complete.
az aks create --resource-group myMicroserviceResources --name myMicroserviceCluster --node-count 1 --enable-addons http_application_routing --generate-ssh-keys
Run the following command to download the credentials to deploy to your AKS cluster:
az aks get-credentials --resource-group myMicroserviceResources --name myMicroserviceCluster
Deploy to Azure
Return to app directory
Since you opened a new command prompt in the previous step, you'll need to return to the directory you created your service in.
Since you opened a new terminal in the previous step, you'll need to return to the directory you created your service in.
Create a deployment file
The AKS tools use a .yaml file to define how to deploy your container.
Run the following command to create an empty deploy-myMicroservice.yaml file.
echo . > deploy-myMicroservice.yaml
Open the deploy-myMicroservice.yaml file in the text editor of your choice and replace the contents with the following contents. Make sure to replace [YOUR DOCKER ID] with your actual Docker ID.