Sunday, October 18, 2020

Deploying an application to Azure Kubernetes Service (AKS)

Azure Kubernetes Service (AKS) manages hosted Kubernetes environment and makes it easy to manage containerize application on Azure. While the AKS makes the process quick and easier, there are a lot of parts and steps involved which makes the learning process sometimes overwhelming. Based on my own learning experience, I came up with a simple set of recipes for deploying an application into the Azure Kubernetes Service (AKS) which I am sharing through this post. The recipes demonstrates illustrates how to set up a development environment, containerize an application using Docker, save the image to Azure Container Registry (ACR) and finally deploy an image from registry to an Azure Kubernetes Service (AKS) cluster. Since this recipe includes interaction with Azure, some familiarity with Azure is essential. Likewise, to test out the code and example mentioned, a valid Azure account and subscriptionn is necessary. 

(a)    Set up development environment for Azure Kubernetes Service (AKS) deployment

This step illustrates the preparation of AKS service. This demonstrates setting up a windows machine to work with Docker, Kubernetes and Azure. 

(b)    Create a Docker image of an application

This step involves using a java application and dockerize (or containerize) the application. Essentially steps to create a Docker image is described. Topic includes building the code, dockerfile and docker image. 

Images can also be created by modifying the existing container. This appraoch is useful when one needs to reuse existing container and/or for incremental updates. For more information, please visit Creating, Modifying and Updating Docker Image from Container for the appraoch.

(c)     Deploy an application image to Kubernetes

In this step the focus is at deploying an application to a local Kubernetes cluster. Interacting with Kubernetes Command Line Interface (Cli) and monitoring the cluster is demonstrated as well. 

(d)    Store image to the Azure Container Registry (ACR)

In this step, the deployment to Azure is demonstrated. The process discussed how to store an image to Azure Container Registry. This sets the stage and requirements for deploying the application to the Azure in the next stage. Since this involves interacting with Azure some familiarity of Azure is needed and a valid account with Azure is necessary to go through the sample.

(e)    Deploy application image to Azure Kubernetes Service (AKS) 

In this step, deployment of an application to Azure Kubernetes Service (AKS), using a docker image stored in the Azure Container Registry (ACR). 

In the steps outlined above, I demonstrate how to build and execute docker image, use container registry and use Kubernetes cluster in local machine and in the Azure cloud to run the application. 


No comments:

Post a Comment