Open In App

How to Deploy Kubernetes on Azure?

Last Updated : 25 Oct, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Kubernetes, often abbreviated as K8s, is an open-source system for automating the deployment, scaling, and management of containerized applications. It is developed by Google and now managed by CNCF (Cloud Native Computing Foundation).

What is the Use Of AKS (Azure Kubernetes Service)?

  • Service Discovery & Load Balancing: Kubernetes balances network traffic for stable deployments using DNS names or IPs.
  • Storage Orchestration: It automatically attaches storage systems, whether they are local or in the cloud.
  • Automated Rollouts & Rollbacks: Kubernetes updates container states gradually and in a controlled manner to ensure they align with the intended state.
  • Automatic Bin Packing: It optimizes the utilization of CPU and RAM resources within the cluster efficiently.
  • Self-Healing: Restarts, replaces, or kills unresponsive containers for reliability.
  • Secret & Config Management: Stores and manages sensitive data for apps without rebuilding containers or exposing secrets.

AKS (Azure Kubernetes Service)

By shifting the operational burden to Azure, the Azure Kubernetes Service (AKS) makes it easier to install a managed Kubernetes cluster on Azure. Azure manages crucial duties like health monitoring and maintenance as a hosted Kubernetes service. A control plane is automatically established and set up when you create an AKS cluster.

AKS (Azure Kubernetes Service) Architecture

(Azure Kubernetes Service) Architecture will be same as normal kubernetes architecture

  • Node: VMs running containers in AKS.
  • Node Pools: Groups of nodes in AKS.
  • Pods: Smallest units with containers in AKS.
  • Deployments: Manage app deployment in AKS.
  • Control plane: Provides the core Kubernetes services and orchestration of application workloads.

A Kubernetes cluster is divided into two components:

  • Control Plane
  • Nodes
    Azure Kubernetes Architecture

Steps To Setup Azure Kubernetes

Step 1: Navigate to your Azure portal.

Azure Console

Step 2: Click on the Create a resource option. You will be listed with different resources that can be deployed on Azure.

Click on create resource

Step 3: Type in Kubernetes Service or AKS in the search bar. Click on the Create option and select Azure Kubernetes Service (AKS).

Search Azure Kubernets

Step 4: You will be prompted to fill in details about Kubernetes cluster we wish to create. 

Basic Kubernetes details

Step 5: Under basics tab, fill in the required details.

  • Subscription: The subscription in which you wish to create Kubernetes Cluster.
  • Resource Group: Choose the resource group where you wish to create the storage account. If you haven’t created one before, click Create New. You will be prompted to provide a name for the Resource group. Enter the name and click OK.
  • Cluster Preset Configuration: Preconfigured set of settings for AKS. Here, we choose Dev/Test.
  • Kubernetes Cluster Name: Provide a name for the Kubernetes Cluster.

Name of the resource group and cluster

Step 6: Click Review+Create and on the next screen click on Create option.

Review and Create

Step 7: After deployment is finished, you will get a message confirming it.

Deployment is finished

Step 8: Click on Go to resource to access your newly created AKS cluster.

Kubernetes properties Best Practices For Deploying AKS (Azure Kubernetes Service)

  • Authentication and Authorization: Use Kubernetes role-based access control (Kubernetes RBAC).
  • Security and Upgrades: Secure access to the API server, limit container access, and manage upgrades and node reboots.
  • Storage and backups: Choose the appropriate storage type and node size, dynamically provision volumes, and data backups.
  • Pod Security: Secure access to resources, limit credential exposure, and use pod identities and digital key vaults.

Basic Troubleshooting of AKS (Azure Kubernetes Service)

To troubleshoot cluster errors, use `kubectl` commands to inspect deployed resources. Begin by signing in to your AKS cluster.

az aks get-credentials --resource-group MyResourceGroup --name MyManagedCluster

If your cluster is created and visible in the Azure portal, you can usually sign in and use `kubectl` commands for diagnostics.

  • View cluster nodes
kubectl get nodes
  • View pods in the system namespace
kubectl get pods
  • Describe the status of a pod
kubectl describe pod <pod-name>

FAQs On AKS (Azure Kubernetes Service)

1. What are Containers, and How Do They Relate to Kubernetes?

Containers hold all essential components for running software efficiently. Kubernetes manages and optimizes container operations for reliability.

2. What Is a Kubernetes Control Plane, and What Services Does It Provide?

The Kubernetes control plane handles essential services and directs application workloads, overseeing tasks such as scheduling, scaling, and monitoring at the cluster level.

3. How Can I Secure My AKS Cluster’s Access and Data?

Incorporate RBAC, restrict credentials, and utilize pod identities with key vaults to safeguard AKS cluster access and data.

4. How Can I Choose the Appropriate Storage Type and Node Size for My AKS Cluster?

Select storage and node size that match your app’s needs, considering storage and resource requirements.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads