Azure Docs

Overview

This tutorial walks you through provisioning an Azure Kubernetes Service (AKS) cluster, configuring access, and deploying a simple containerized application.

Prerequisites

  • An Azure subscription (free trial works)
  • Azure CLI 2.30+ installed (az version)
  • kubectl 1.27+ installed (kubectl version --client)
  • Git (optional, for cloning the sample app)

Step 1 – Create a Resource Group

Resource groups hold related resources. Replace myResourceGroup and eastus with your preferred names/region.

az group create \
    --name myResourceGroup \
    --location eastus

Step 2 – Create an AKS Cluster

Provision a basic cluster with 2 nodes.

az aks create \
    --resource-group myResourceGroup \
    --name myAKSCluster \
    --node-count 2 \
    --enable-addons monitoring \
    --generate-ssh-keys

Step 3 – Connect to the Cluster

Configure kubectl to use the new cluster.

az aks get-credentials \
    --resource-group myResourceGroup \
    --name myAKSCluster

Verify connection:

kubectl get nodes

Step 4 – Deploy a Sample Application

Deploy a basic NGINX web server.

kubectl create deployment nginx --image=nginx:stable-alpine
kubectl expose deployment nginx --port=80 --type=LoadBalancer

Wait for the external IP and view the site:

kubectl get service nginx

Cleanup

When finished, delete the resource group to avoid charges.

az group delete --name myResourceGroup --yes --no-wait