Deploy on Azure AKS
In this guide, you will learn how to deploy and manage ZIETrans application on Azure AKS, a container orchestration service available on the Microsoft Azure public cloud. Azure AKS enables you to deploy, scale up, scale down and manage containers in the cluster environment.
Prerequisites:
-
An Azure subscription.
-
Azure CLI or Azure PowerShell installed.
-
Helm v3 installed.
Create an AKS cluster
To deploy your ZIETrans application on Azure AKS, you need to create an AKS cluster. Additionally, ensure that your new AKS cluster has access to your Azure Container Registry (ACR) in order to pull the necessary container images and execute them. To accomplish this, follow these steps:
Use the az aks create command to establish an AKS cluster named myAKSCluster. Employ the --attach-acr parameter to grant the cluster access to the myhelmacr ACR:
$ az aks create --resource-group myResourceGroup --name myAKSCluster --location eastus --attach-acr myhelmacr --generate-ssh-keys
Note : User should create the Resource Group (myResourceGroup) and Azure Container Registry (myhelmacr) before creating the AKS Cluster and provide appropriate user access.
Connect to your AKS cluster
To interact with your AKS cluster, you'll need to use the Kubernetes command-line client, kubectl. If you are using Azure Cloud Shell, kubectl is already installed.
Configure kubectl to connect to your Kubernetes cluster using the following command. This command retrieves the necessary credentials for your AKS cluster named "myAKSCluster" in the "myResourceGroup" :
$ az aks get-credentials --resource-group myResourceGroup --name myAKSCluster
Prepare and Run your Helm chart
Preparing the chart:
| Parameters | Description | Value |
|---|---|---|
| repository | Repository name of ZIETrans Application in the ACR | myhelmacr.azurecr.io/zietrans |
| pullPolicy | image pull policy | IfNotPresent |
| tag | image tag | latest |
| service.type | type of the service | LoadBalancer |
| service.port | port for the service | 9080 |
| storageClassName | Provide the storage class as per the requirement | default |
Running the chart:
To install your application using your Helm chart, employ the helm install command as follows:
$ helm install <release-name> .
It takes a few minutes for the service to return a public IP address. You can monitor the progress using the following command:
$ kubectl get service azure-vote-front --watch
You can access the ZIETrans application by navigating to your application's load balancer in a web browser using the
Delete the cluster
To remove all resources, including the resource group, AKS cluster, container registry, container images stored in the ACR, and related resources, use the following command:
$ az group delete --name myResourceGroup --yes --no-wait