devops

Azure Kubernetes Service (AKS)

Portal steps for an AKS cluster, Cloud Shell kubeconfig, deploy the voting app


AKS gives you a managed Kubernetes API in Azure; you choose SKU, node pools, networking, and identity integration (managed identity / service principal).

Sign in at Azure Portal. If you are new, read current Azure free account terms before creating resources.

AKS prerequisites summary

Find AKS in the portal

From the home page, search for Kubernetes or AKS and open Kubernetes services.

Azure portal home / services

Create a cluster

  1. CreateKubernetes cluster.
  2. Choose subscription and resource group (create one if needed).
  3. Cluster name (e.g. example-voting-app), region, Kubernetes version.
  4. Node pools: for a lab, one small node is enough.
  5. Identity: typically use a system-assigned managed identity or create a service principal as the wizard describes.

Authentication and identity during AKS create

  1. Review + create and wait until deployment completes.

Deployment succeeded

Connect with Azure Cloud Shell

Open Cloud Shell in the portal (>_ icon). It includes kubectl and az.

Microsoft documents the flow here: Connect to the cluster (screenshots in the portal move over time).

Azure docs — connect to cluster

Point kubectl at your cluster (replace names):

Terminal window
az aks get-credentials --resource-group MY_RG --name MY_AKS_NAME
kubectl get nodes

Example style of output:

NAME STATUS ROLES AGE VERSION
aks-agentpool-xxxxxxxx-vmss000000 Ready agent 6m v1.29.x

Deploy the voting application

Terminal window
git clone https://github.com/dockersamples/example-voting-app.git --depth 1
cd example-voting-app/k8s-specifications

Apply in safe order (example):

Terminal window
kubectl apply -f redis-deployment.yaml -f redis-service.yaml
kubectl apply -f db-deployment.yaml -f db-service.yaml
kubectl apply -f worker-deployment.yaml
kubectl apply -f vote-deployment.yaml -f vote-service.yaml
kubectl apply -f result-deployment.yaml -f result-service.yaml
kubectl get deployments,svc

Use LoadBalancer-type Services for vote and result in cloud if external IPs stay <pending> with NodePort on Azure (same pattern as other providers).

Test

Open the EXTERNAL-IP (or hostname) for the voting and result Services in two browser tabs; vote and watch totals update.

Results split view

Cleanup

Delete the resource group (or at minimum the AKS resource) when you are done so compute and public IPs do not keep charging.