Deploying your Application on Azure Kubernetes Service

Deploying your Application on Azure Kubernetes Service

What is Azure Kubernetes Service (AKS)?

Azure Kubernetes Service (AKS) is a managed Kubernetes service provided by Microsoft. It allows you to deploy and manage containerized applications without the need to handle the complexities of managing your own Kubernetes clusters. Here are some key points about AKS:

  • Managed Kubernetes: AKS takes care of critical operations related to Kubernetes, such as health monitoring, maintenance, and scaling.

  • Minimal Expertise Required: You don’t need extensive container orchestration expertise to use AKS.

  • Ideal Platform: AKS is ideal for deploying applications that require high availability, scalability, portability, and integration with existing DevOps tools.

Use Cases for AKS

  1. Lift and Shift to Containers:

    • Migrate existing applications to containers and run them in a fully managed Kubernetes environment.

    • Benefit from streamlined horizontal scaling, self-healing, load balancing, and secret management.

  2. Microservices Deployment:

    • Simplify the deployment and management of microservices-based applications.

    • AKS provides efficient horizontal scaling, load balancing, and secret management for microservices.

  3. Secure DevOps with Kubernetes:

    • Implement secure DevOps practices by using AKS.

    • Balance speed and security effectively.

  4. Bursting from AKS with ACI:

    • Use virtual nodes to provision pods inside Azure Container Instances (ACI).

    • ACI pods start in seconds and scale to meet demand.

  5. Machine Learning Model Training:

    • Train machine learning models using large datasets with familiar tools like TensorFlow and Kubeflow.

Benefits Over Azure Virtual Machine (VM)

  1. Automatic Scaling:

    • Kubernetes (used by AKS) automatically scales applications based on demand.

    • In a VM environment, scaling can be more complex

  2. Managed Service:

    • AKS is fully managed by Azure, reducing operational overhead.

    • VMs require manual configuration and management.

  3. Containerization:

    • AKS focuses on containerized applications, providing better isolation and resource utilization.

    • VMs are less optimized for container workloads.

So, why not directly jump in to deploy an application over AKS Service and check out configurations?

  1. Head towards Azure Portal and start creating (deploying) your Kubernetes cluster. Just search Kubernetes Service, and you will get it.

  2. Start by providing your required details in the required sections.

  3. Please arrange your node pool that will help us to manage our workloads.

  4. Setting up the cluster network.

  5. Finally, go ahead with creating your deployment.

  6. Now, let's connect our terminal (local) to this cluster.

     az aks get-credentials --resource-group <resource group name> --name <cluster name> --overwrite-existing
    

    This is the general syntax that you can use to connect with the cluster. Make sure you're logged into the Azure CLI already.

    Heyy! what? Merged? Yes, we locally always have kube configuration file and that cluster's information is now saved into your local config file. Go ahead with managing the stuffs.

    OK! Here we go with the confirmation, as the current context in which we are currently working is instragram-clone-frontend-cluster which we created on the portal. This is now available to us locally.

  7. Now, here comes the very important step: we need to create a deployment of our application, whose image will be pulled from a container registry. In this tutorial, I am using Dockerhub as a container registry.

  8. Creating a LoadBalancer type service for our application to expose the deployment.

  9. Use kubectl get svc to achieve the External IP for communication.

  10. Requesting the given IP.

So here you've successfully deployed your application using the AKS Service. Make sure to command to deployment and service topic as these helps us to achieve the deployment in the production.

Some References:

  1. What is Azure Kubernetes Service (AKS)? - Azure Kubernetes Service | Microsoft Learn

  2. Kubernetes on Azure - Enterprise Expertise | Microsoft Azure

  3. Microsoft for Startups | Microsoft

  4. tauqeerops/insta-clone-frontend general | Docker Hub