Azure Kubernetes Service (AKS): Running Containers at Scale Without Running the Brain

Azure Kubernetes Service (AKS): Running Containers at Scale Without Running the Brain

A clear, step-by-step guide to AKS: containers, Kubernetes, clusters, node pools, networking, identity, storage, scaling, security, upgrades, monitoring and cost, with every term explained in plain words.

Imagine a huge restaurant chain with hundreds of kitchens spread across a city. Each kitchen cooks the same dishes from the same recipe cards. Someone must decide which kitchen cooks which order, replace a kitchen that catches fire, open more kitchens when the lunch rush arrives and close them when it ends, and make sure that every kitchen always uses the newest recipe. That someone is not a cook. It is a skilled operations manager who never touches the food but keeps the whole network running smoothly.

Kubernetes is that operations manager for software. Azure Kubernetes Service, or AKS, is the version where Microsoft hires and runs the manager for you, so you can focus on cooking the dishes, which are your applications. In this guide, we will learn AKS from the very beginning. You do not need earlier experience with containers or clusters. Every new word will be explained the first time it appears, with what it is, why it exists, a simple comparison from everyday life, and a practical example. By the end, you will understand how AKS is built, how traffic and data move through it, how to secure, scale, monitor and pay for it, and which mistakes to avoid.

1The Problem: Running Many Applications Reliably

Before the solution makes sense, we must feel the problem.

In the early days, one application ran on one server. If the server failed, the application stopped. If the application became popular, the team bought a bigger server. Over time, companies built dozens of small applications instead of one giant program, an approach called microservices, where each small service does one job, such as handling payments, sending emails or searching products. This makes teams faster and systems easier to change, but it creates a new problem: now there are hundreds of small pieces to start, connect, update, repair and scale.

Problem 1

Placement

Which server should run which program? Doing this by hand wastes space and leaves some servers empty while others are overloaded.

Problem 2

Failure

Servers and programs crash. Someone must notice and restart them quickly, day and night.

Problem 3

Scaling

Traffic rises and falls. Adding and removing copies by hand is slow and error-prone.

Problem 4

Updates

Releasing a new version without downtime, and rolling back if it is bad, is hard to do safely by hand.

Problem 5

Connection

Services must find and talk to each other, even though their addresses keep changing.

Simple Analogy

Running one café is easy; the owner does everything. Running two hundred cafés with different menus, staff and opening hours is impossible without a head office that assigns staff, tracks stock, replaces broken equipment and opens new branches when needed. Kubernetes is that head office for software.

2Containers: The Lunch Boxes of Software

Kubernetes manages containers, so we must understand them first.

A container is a small, sealed package that holds an application together with everything it needs to run: its code, libraries and settings. Containers run on top of an operating system but are isolated from one another, so one cannot disturb another. Unlike a virtual machine, which carries a whole operating system inside it, a container shares the host’s operating system core, so it is much smaller and starts in seconds.

A container image is the frozen template from which containers are created. You build an image once, and run it anywhere as many times as you like. Images are stored in a container registry, which is like a library of images. On Azure, the registry service is Azure Container Registry, or ACR. The program that actually runs containers on a machine is a container runtime; AKS uses containerd.

QuestionVirtual machineContainer
What does it contain?A full operating system plus the applicationOnly the application and its libraries
Typical sizeGigabytesMegabytes to a few hundred megabytes
Start timeMinutesSeconds
IsolationStrong, separate operating systemGood, shared operating system core
DensityFewer per serverMany per server
Simple Analogy

A virtual machine is like renting a whole apartment, with its own kitchen and bathroom, just to store one suitcase. A container is the suitcase itself, which fits into any apartment’s cupboard, and you can carry it to a different building without unpacking.

i
Containers Should Be Disposable

A container can be stopped and replaced at any time. Anything you must keep, such as customer data, belongs outside the container in storage or a database.

3Kubernetes: The Container Manager

Kubernetes is open-source software that runs and looks after containers across many machines.

Kubernetes, often written K8s, was created at Google and is now maintained by a large open community. A group of machines running Kubernetes is called a cluster. You tell Kubernetes what you want, for example “keep five copies of this application running, reachable at this address”, and Kubernetes works constantly to make reality match your wish. This idea is called the desired state. If a copy crashes, Kubernetes notices the difference between desired and actual state and starts a new copy. You describe the destination; Kubernetes drives the car.

Ability

Scheduling

Picks the best machine for each container based on free capacity and rules.

Ability

Self-healing

Restarts failed containers, replaces unhealthy ones and avoids sending traffic to broken copies.

Ability

Scaling

Adds or removes copies manually or automatically.

Ability

Rolling updates

Replaces old versions with new ones gradually, and can roll back.

Ability

Service discovery and load balancing

Gives groups of containers a stable name and spreads traffic among them.

Ability

Configuration and secrets

Supplies settings and sensitive values to containers without baking them into images.

Simple Analogy

You give a hotel manager the instruction “always keep ten rooms clean and ready”. The manager assigns cleaners, replaces a cleaner who falls ill and adds extra staff on busy weekends. You never tell individual cleaners what to do.

4What AKS Adds on Top of Kubernetes

AKS is Kubernetes with the hardest operating work handled by Microsoft.

Running Kubernetes yourself is demanding. You must install it, protect its central brain, keep it highly available, back up its data, upgrade it every few months and fix problems. Azure Kubernetes Service is a managed service: Microsoft runs and maintains the cluster’s control plane, the central brain, at no extra charge in the free tier, while you manage the worker machines that run your applications and the applications themselves. This split is called the shared responsibility model.

AreaMicrosoft managesYou manage
Control plane (API server, scheduler, cluster data)Yes: setup, patching, availabilityChoose settings and tier
Worker nodesProvides images and upgrade toolsChoose sizes, count, upgrade timing
Applications and containersNoYes
Network design and security rulesProvides featuresYes
Access control and secretsProvides integrationsYes
Cost and capacity planningNoYes

AKS also connects naturally with other Azure services: Microsoft Entra ID for sign-in, Azure Container Registry for images, Azure Key Vault for secrets, Azure Monitor for observability, Azure Policy for governance, Azure disks and files for storage, and Microsoft Defender for Cloud for security.

Simple Analogy

Building your own power plant to light a factory is possible but exhausting. Buying electricity from the grid lets you focus on making products. AKS is buying the grid supply of Kubernetes, while you still choose the machines in your factory.

5AKS Architecture: Control Plane and Nodes

Every AKS cluster has a managed brain and a set of worker machines.

flowchart TB
    subgraph CP["Control plane: managed by Microsoft"]
        API["API server: front door for all commands"]
        ETCD["etcd: the cluster's database"]
        SCH["Scheduler: chooses a node for each pod"]
        CM["Controller manager: keeps desired state"]
    end
    subgraph NP["Node pools: your worker machines"]
        N1["Node 1: kubelet + containerd + pods"]
        N2["Node 2: kubelet + containerd + pods"]
        N3["Node 3: kubelet + containerd + pods"]
    end
    USER["You, pipelines, tools"] --> API
    API --> ETCD
    API --> SCH
    API --> CM
    API --> N1
    API --> N2
    API --> N3
        
FIG 1 — The managed control plane and the worker nodes of an AKS cluster
Control plane

API server

The single entrance. Every command, from you or from internal components, passes through it after authentication and permission checks.

Control plane

etcd

A reliable key-value database holding the entire cluster state, such as what should be running where.

Control plane

Scheduler

Decides which node should run each new pod, based on resources and rules.

Control plane

Controller manager

A set of loops that compare desired and actual state and fix differences.

Node

Kubelet

The agent on each node that receives instructions and makes sure containers are running and healthy.

Node

Container runtime

containerd actually starts and stops containers.

Node

Network proxy

Handles traffic rules so that service names reach the right pods.

Simple Analogy

The control plane is head office with its reception desk, record room, planning team and supervisors. The nodes are the branch kitchens where the cooking happens, each with a local supervisor, the kubelet, who follows head office’s instructions.

i
You Rarely See the Control Plane

In AKS, the control plane runs in Microsoft’s managed environment. You interact with it only through its API address, not by logging into its machines.

6The Building Blocks: Pods, Deployments and Services

A handful of Kubernetes objects describe almost everything you run.

Object

Pod

The smallest unit. A pod holds one or a few tightly related containers that share a network address and storage. Pods are temporary: when they die, new ones replace them with new addresses.

Object

ReplicaSet

Makes sure a chosen number of identical pods are running at any time.

Object

Deployment

The usual way to run a stateless application. It manages ReplicaSets and handles rolling updates and rollbacks.

Object

StatefulSet

For applications that need stable names and their own storage, such as some databases.

Object

DaemonSet

Runs one pod on every node, useful for log collectors and monitoring agents.

Object

Job and CronJob

Run a task to completion once, or on a schedule.

Object

Service

A stable name and address in front of a changing group of pods, which also spreads traffic among them.

Object

Ingress

Rules for routing outside web traffic to services based on host names and paths.

Object

ConfigMap and Secret

Hold settings and sensitive values, supplied to pods at start-up.

Object

Namespace

A virtual partition of the cluster, used to separate teams, projects or environments.

Simple Analogy

A pod is a single chef at a station. A deployment is the rule “always keep five chefs at this station”. A service is the pass-through window with a number on it, so waiters always go to the same window no matter which chef is on duty. A namespace is a separate kitchen floor for each restaurant brand.

Kubernetes objects are normally described in text files called manifests, written in a format such as YAML. These files state the desired state, are stored in version control and are applied to the cluster. This is the practice of describing infrastructure and applications as files rather than clicking in screens.

Nodes are organized into pools so different workloads can have different machines.

A node is a worker machine, in AKS a virtual machine, that runs pods. A node pool is a group of identical nodes, backed by an Azure virtual machine scale set that makes it easy to add or remove machines. A cluster can have several pools.

System node pool

Runs essential cluster components such as DNS and metrics services. Every cluster needs at least one. For production, it should have enough nodes, spread across availability zones, and be kept for system pods rather than your applications.

User node pools

Run your applications. You can create several, for example a general pool of balanced machines, a memory-heavy pool for caches, a GPU pool for machine learning, or a Windows pool for Windows containers. Pods are directed to the right pool using labels and rules.

Spot node pools

Use Azure’s spare capacity at deep discounts, with the risk that machines can be removed with short notice. Excellent for interruptible batch work, not for critical services.

Choice

Operating system

Linux is the common choice, with Azure Linux and Ubuntu options. Windows nodes exist for Windows containers.

Choice

VM size

Choose according to pod needs. Too small causes waste from fragmentation; too large concentrates risk.

Choice

Availability zones

Spread nodes across zones, which are separate buildings inside a region, to survive a data center failure.

Choice

Disk type

Managed or ephemeral OS disks. Ephemeral disks are faster and cheaper but not persistent.

Simple Analogy

A restaurant chain has a pool of standard kitchens, a pool of large banquet kitchens and a pool of temporary pop-up stalls rented cheaply for festival days. Head office sends each order to the kind of kitchen that suits it.

8Cluster Tiers and AKS Automatic

AKS offers different levels of service and different amounts of hands-on control.

AKS clusters come in pricing tiers. The Free tier has no charge for the control plane and no financially backed uptime guarantee, suitable for learning and tests. The Standard tier adds a financially backed service level agreement for the API server’s availability, higher limits and is recommended for production. A Premium tier adds long-term support for specific Kubernetes versions, for organizations that cannot upgrade as often. In all tiers, you pay for the nodes and other resources you use. Check the current pricing page, since details change.

There are also two management modes. AKS Standard gives you full control over choices such as node pools, networking and add-ons, while you take responsibility for configuring them well. AKS Automatic is a more opinionated mode in which Microsoft applies many production best practices by default, such as managed node provisioning, scaling, networking, security settings and monitoring, reducing the number of decisions you must make. It suits teams that want Kubernetes without becoming Kubernetes experts, though with less freedom to customize.

ModeControlEffortGood for
AKS StandardHigh: you choose most settingsHigherTeams with Kubernetes skills and special needs
AKS AutomaticGuided: sensible defaults are appliedLowerTeams wanting quick, safe production clusters
Simple Analogy

Standard is like buying a car with a manual gearbox and a toolkit; you tune it your own way. Automatic is the same car with automatic gears and safety assistance switched on; easier, though fewer ways to tinker.

i
Check Current Features

AKS evolves quickly. Feature names, tiers and defaults change between versions, so confirm details in the current Azure documentation before designing around them.

9Internal Working: From Your Command to a Running Pod

Let us follow one request through the cluster to see how the pieces cooperate.

sequenceDiagram
    participant U as You or pipeline
    participant A as API server
    participant E as etcd
    participant C as Controllers
    participant S as Scheduler
    participant K as Kubelet on node
    participant R as containerd
    U->>A: Apply deployment: 3 copies of my app
    A->>A: Authenticate, authorize, validate
    A->>E: Store desired state
    C->>A: Notice deployment needs 3 pods
    C->>A: Create pod records
    S->>A: Notice unassigned pods
    S->>A: Assign each pod to a node
    K->>A: Notice pod assigned to my node
    K->>R: Pull image and start container
    K->>A: Report pod running and healthy
        
FIG 2 — The life of a deployment request, from command to running pods
1

Authenticate and authorize

The API server checks who you are and whether you may do this action in this namespace.

2

Admission checks

Rules can modify or reject the request, for example a policy that forbids images from untrusted registries.

3

Record the desired state

The request is saved in etcd as the new truth.

4

Controllers create the pods

The deployment controller and ReplicaSet controller make the pod records needed.

5

Scheduler chooses nodes

It filters nodes that cannot host the pod and scores the rest, choosing the best.

6

Kubelet starts containers

The node pulls the image from the registry, starts the container and begins health checks.

Simple Analogy

A request to “open three more food stalls” goes to reception, is checked and filed, a planner creates the stall records, a dispatcher decides which market each stall goes to, and a local supervisor opens it and reports back.

The most important lesson is that Kubernetes works through control loops. No single component commands the others in a rigid order. Instead, each component watches the shared record of desired state and acts on the differences it sees. This makes the system resilient: if a component restarts, it simply resumes watching.

10Resource Requests, Limits and Scheduling Control

Telling Kubernetes how much each pod needs is the secret of stable clusters.

Each container can declare a request, the amount of processor and memory it needs to run well, and a limit, the maximum it may use. The scheduler uses requests to decide where a pod fits. At runtime, limits protect neighbors: a container that uses more memory than its limit can be stopped and restarted, and one that wants more processor than its limit is slowed down.

Tool

Requests

Reserve capacity for scheduling. Too low causes crowding and slowness; too high wastes money.

Tool

Limits

Cap usage to protect other pods on the node.

Tool

Labels and selectors

Tags on objects and queries that match them. Used to group pods and direct traffic or placement.

Tool

Node affinity, taints and tolerations

Rules that attract pods to certain nodes, or keep pods away unless they explicitly accept a marker, such as dedicating a pool to GPU work.

Tool

Topology spread

Spreads copies across zones and nodes so one failure does not remove them all.

Tool

Pod disruption budgets

Limit how many copies may be taken down at once during maintenance, keeping the service available.

Simple Analogy

Booking seats for a group at a restaurant works the same way. The request is the number of seats you reserve, and the limit is the largest table you may ever occupy. If everyone reserves too many seats, the restaurant looks full but is empty. If everyone reserves too few, people are squeezed.

!
Common Mistake

Deploying pods with no requests or limits. One greedy pod can starve others, nodes become unstable, and the autoscaler cannot make good decisions. Always set sensible values and adjust them using monitoring data.

11Health Checks: Probes

Kubernetes needs to know whether your application is alive and ready.

A running container is not always a healthy application. It might be stuck, or still loading data. Kubernetes uses probes, small regular checks, to find out.

Liveness probe

Asks “are you still alive?” If the check fails repeatedly, Kubernetes restarts the container. This fixes applications that have frozen.

Readiness probe

Asks “are you ready for traffic?” While it fails, the pod is removed from the service’s list, so no users are sent to it. This protects users during start-up or temporary overload.

Startup probe

Gives slow-starting applications extra time before other probes begin, preventing premature restarts.

Simple Analogy

A restaurant manager checks whether a chef is conscious (liveness) and whether the chef’s station is set up and ready to take orders (readiness). A new chef still tying an apron is not sent customers yet.

i
Keep Probes Honest

A liveness probe that depends on a database may cause all pods to restart together if the database is slow, turning a small problem into an outage. Make liveness checks simple and local.

12Networking in AKS

Networking is the most important design decision, and the hardest to change later.

Every pod needs an address, and pods on different nodes must reach each other. AKS offers several network plugins, which decide how addresses are assigned.

OptionHow pods get addressesNotes
Azure CNI (node subnet)Each pod gets an address from the virtual network’s subnetPods are directly reachable on the network; uses many addresses, so plan the subnet size
Azure CNI OverlayPods get addresses from a separate private range; only nodes use the virtual network addressesSaves virtual network addresses and scales to many pods; a common modern choice
Azure CNI powered by CiliumUses the Cilium data plane for efficient networking and policyRich network policy and observability features
kubenetSimple, basic address model with routing tablesOlder option with limitations; Microsoft has announced its retirement, so avoid for new clusters

Because plugin choice is difficult to change later, decide it at the start, size address ranges for future growth, and check the current recommendations in the documentation.

Concept

Virtual network integration

Nodes live in an Azure virtual network, so they can reach databases, other services and on-premises networks through private routes.

Concept

Outbound traffic

How pods reach the internet. Choices include the cluster load balancer, a NAT gateway for stable, scalable outbound addresses, or routing through a firewall.

Concept

DNS inside the cluster

Services get names such as “orders”, found by other pods without knowing any IP address.

Concept

Network policies

Firewall rules between pods, controlling which pods may talk to which. Without them, all pods can talk to all pods.

Simple Analogy

Choosing the network plugin is like deciding the address system of a new town before building houses. Fixing street numbering after thousands of homes are built is painful.

13Services and Ingress: Getting Traffic In

Users on the internet need a stable door into your changing pods.

flowchart LR
    USER["User on the internet"] --> DNS["DNS name"]
    DNS --> LB["Azure public load balancer or application gateway"]
    LB --> ING["Ingress controller pods"]
    ING -->|"/shop"| S1["Service: shop"]
    ING -->|"/pay"| S2["Service: payments"]
    S1 --> P1["Pod"]
    S1 --> P2["Pod"]
    S2 --> P3["Pod"]
    S2 --> P4["Pod"]
        
FIG 3 — A request travels from the internet through a load balancer and ingress to the right pods
Type

ClusterIP

An internal address, reachable only inside the cluster. The default and most used for service-to-service calls.

Type

LoadBalancer

Asks Azure to create a load balancer with an external address in front of the service. Simple, but one address per service.

Type

Ingress

One entry point that routes many websites and paths to different services, and handles certificates for HTTPS.

Ingress needs an ingress controller, the software that reads the rules and routes the traffic. Common AKS choices include the managed application routing add-on, which provides a managed NGINX-based controller, Azure Application Gateway for Containers, and other popular controllers you install yourself. Each differs in features such as web application firewall, certificate handling and cost, so compare them before deciding. Older approaches such as the Application Gateway Ingress Controller are also still found in many clusters.

Simple Analogy

The ClusterIP is the internal phone extension. A LoadBalancer is a separate street door for each department. Ingress is the main reception of a building that reads each visitor’s destination and sends them to the right floor.

i
Use Private Entrances When Possible

Internal applications can use internal load balancers with private addresses, keeping them off the public internet.

14Storage in AKS

Containers forget everything when they stop, so lasting data needs special handling.

A pod’s own filesystem disappears when the pod is replaced. For data that must survive, Kubernetes uses a small set of ideas. A PersistentVolume, or PV, is a piece of storage in the cluster. A PersistentVolumeClaim, or PVC, is a request by a pod for storage of a certain size and type. A StorageClass describes a kind of storage and lets Kubernetes create it on demand, which is called dynamic provisioning. The connection to Azure storage is handled by CSI drivers, standard plug-ins for storage.

Azure storage typeAccess styleGood for
Azure DisksOne node at a time (block storage)Databases and single-instance stateful apps; fast; tied to one zone unless using zone-redundant types
Azure FilesMany pods at once (shared file system)Shared content, configuration files and legacy apps needing shared folders
Azure Blob via CSIMany pods, object storage mounted as filesLarge unstructured data; performance differs from true file systems
Local ephemeral disksNode-local, temporaryScratch space, caches; lost when the node is replaced
Tip

Prefer managed databases

For important data, a managed database service such as Azure SQL or Cosmos DB often removes the burden of running state inside the cluster.

Tip

Plan zones and backups

Disks live in a zone, so pods using them must run in that zone. Use snapshots and backup tools for recovery.

Tip

Match performance to need

Choose disk types and sizes by speed and cost, and watch for oversizing.

Simple Analogy

A kitchen’s whiteboard is wiped every night, so recipes must be stored in a proper filing cabinet. The PVC is the form requesting a drawer of a given size, and the StorageClass is the catalog of cabinet types.

15Identity and Access Control

Several layers decide who may do what, to the cluster and from the cluster.

1

Human sign-in with Microsoft Entra ID

Integrate the cluster with Entra ID so people sign in with work accounts, with multifactor authentication and conditional access, and can be removed centrally.

2

Permissions inside the cluster

Kubernetes role-based access control, RBAC, defines roles with allowed actions on objects, assigned to users or groups per namespace or for the whole cluster. Azure RBAC for Kubernetes lets you manage these with Azure role assignments.

3

Cluster identity

The cluster itself uses a managed identity to create Azure resources like load balancers, so there is no password to manage.

4

Workload identity for pods

Individual applications get their own Entra identity through workload identity federation, to call services such as Key Vault, storage or databases without stored secrets. This replaces the older pod identity approach.

5

Registry access

Nodes pull images from Azure Container Registry using a managed identity with only pull rights.

Simple Analogy

A large building has staff badges for employees, room keys for specific floors, a master key only for the maintenance team, and special passes for delivery robots. AKS identity works the same: different badges for different actors, each with the minimum rights.

!
Common Mistake

Giving everyone cluster-admin rights, or leaving the local administrator account in use. Disable local accounts where possible, use groups for access, and grant roles only on the namespaces people need.

16Secrets and Configuration

Passwords and keys need much stronger protection than ordinary settings.

Kubernetes has a Secret object, but by default its values are only encoded, not strongly protected, and anyone with permission to read them can see them. A safer pattern on Azure is to keep secrets in Azure Key Vault, a hardened service for secrets, keys and certificates, and let pods read them using the Secrets Store CSI driver with the Key Vault provider. The pod gets the value at start-up, using its workload identity, and values can be rotated centrally without rebuilding images.

Do

Separate config from images

Use ConfigMaps for non-sensitive settings, so one image works in every environment.

Do

Use Key Vault for secrets

Centralized control, auditing and rotation.

Do

Encrypt at rest

Enable encryption options for cluster data and consider customer-managed keys when rules require.

Avoid

Secrets in images or code

Anyone who can read the image or repository can read the secret.

Simple Analogy

Instead of writing the safe’s combination on a sticky note on every cook’s apron, the restaurant keeps it with the manager, who gives it for a short time to the person who needs it and changes it regularly.

17Scaling: Pods, Nodes and Events

AKS can adjust capacity at several levels, and each level solves a different problem.

flowchart TB
    L["Load increases"] --> HPA["Horizontal Pod Autoscaler or KEDA: add more pods"]
    HPA --> Q{"Enough room on nodes?"}
    Q -- Yes --> OK["Pods are scheduled"]
    Q -- No --> PEND["Pods stay Pending"]
    PEND --> CA["Cluster autoscaler or Node Auto Provisioning: add nodes"]
    CA --> OK
    L2["Load decreases"] --> HPA2["Fewer pods"]
    HPA2 --> CA2["Idle nodes removed"]
        
FIG 4 — Scaling layers: pods first, then nodes when space runs out
Pod level

Horizontal Pod Autoscaler

Adds or removes pod copies based on measurements like processor use or custom metrics.

Pod level

KEDA

Event-driven scaling that reacts to queue length, message counts or schedules, and can scale to zero. Available as an AKS add-on.

Pod level

Vertical Pod Autoscaler

Suggests or adjusts the size of requests for each pod.

Node level

Cluster autoscaler

Adds nodes when pods cannot be scheduled, and removes underused nodes. Works per node pool within minimum and maximum limits.

Node level

Node auto provisioning

A newer, Karpenter-based approach that chooses suitable machine sizes automatically for pending pods, instead of relying only on preset pools.

Simple Analogy

At a busy lunch, the restaurant first asks more chefs to work at the existing stations (pod scaling). When all stations are full, it opens new kitchens (node scaling). When lunch ends, the extra chefs go home, and then the extra kitchens close.

!
Common Mistake

Setting autoscaler limits too high without budget alerts, or relying on autoscaling without setting resource requests. A bug causing endless pods can create a very large bill, so set maximum limits and cost alerts.

18Deployment Flow: From Code to Cluster

A healthy team delivers changes through an automated, repeatable pipeline.

flowchart LR
    DEV["Developer commits code"] --> CI["CI pipeline: build and test"]
    CI --> IMG["Build container image"]
    IMG --> SCAN["Scan image for vulnerabilities"]
    SCAN --> ACR["Push to Azure Container Registry"]
    ACR --> GIT["Update manifests in Git"]
    GIT --> GO["GitOps agent in cluster, such as Flux"]
    GO --> AKS["AKS applies desired state"]
    AKS --> MON["Monitor health and roll back if needed"]
        
FIG 5 — A typical path from code commit to a running update in AKS
1

Build once

Create an image with a unique version tag. Never use a moving tag such as “latest” in production.

2

Scan and sign

Check images for known weaknesses and, where required, sign them so the cluster can verify them.

3

Declare the desired state in Git

Store manifests or package definitions in version control, with reviews by pull request.

4

Let the cluster pull changes

GitOps tools such as Flux, available as an AKS extension, watch the repository and apply changes, keeping the cluster matched to Git.

5

Release progressively

Use rolling updates, and for sensitive services canary or blue-green releases that send a small share of traffic to the new version first.

Simple Analogy

A new recipe is tested in a lab kitchen, checked by an inspector, filed in the head-office cookbook, and then branches copy it automatically. Nobody walks into branches with handwritten notes.

Package tools such as Helm bundle many manifests into one reusable package, called a chart, with adjustable settings. Kustomize helps adjust manifests for different environments without copying them. Both are widely used with AKS.

19Cluster Security in Depth

Security in Kubernetes works in layers, from the cloud around the cluster to the code inside.

Layer 1

Protect the API server

Use private clusters or API server VNet integration so the API is not open to the internet, and limit access with authorized IP ranges when public.

Layer 2

Protect the nodes

Use hardened node images, keep them updated, restrict SSH access and avoid direct logins in normal operations.

Layer 3

Protect the network

Use network policies, private endpoints for Azure services, and a firewall for outbound control.

Layer 4

Protect the workloads

Run containers as non-root users, drop unneeded privileges, use read-only filesystems and apply the Pod Security standards.

Layer 5

Protect the supply chain

Use trusted base images, scan regularly, remove old images automatically and restrict registries through policy.

Layer 6

Detect and respond

Use Microsoft Defender for Containers for threat detection and recommendations, and keep audit logs.

Azure Policy for Kubernetes enforces rules inside the cluster using an admission controller. Examples: forbid privileged containers, require resource limits, allow only images from your registry, and require certain labels. Policy turns good intentions into enforced guardrails.

Simple Analogy

A secure building has a fence, a guarded gate, locked doors, internal access cards, cameras and an alarm. A burglar who defeats one layer meets the next. A cluster needs the same layered defense.

!
Common Mistake

Leaving the default “everything can talk to everything” network behavior and running containers as root. If one pod is compromised, the attacker moves freely. Add network policies and restrict privileges from the first deployment.

20Monitoring, Logging and Metrics

You cannot fix what you cannot see, and clusters produce a lot to see.

Tool

Container Insights

Azure Monitor feature that collects logs and performance data from nodes, pods and containers, with ready dashboards.

Tool

Managed Prometheus

Azure Monitor managed service for Prometheus metrics, the standard Kubernetes metrics format, without running your own servers.

Tool

Azure Managed Grafana

Hosted dashboards that visualize Prometheus and Azure data.

Tool

Application Insights and OpenTelemetry

Trace requests through your microservices to find slow or failing steps.

Tool

Control plane logs

Diagnostic settings can send API server and audit logs to a workspace for investigation and security review.

Tool

Alerts

Recommended alert rules cover node and pod health, resource pressure and failed pods.

What to watchWhy it matters
Node processor and memoryPressure causes slowdowns and evictions
Pod restarts and Pending podsRestarts show crashes; Pending shows lack of capacity or bad rules
Request and error rates, latencyThe direct experience of users
Autoscaler activityShows whether scaling works as expected
Disk and volume usageFull disks cause outages
Cost per namespaceShows which teams drive the bill
Simple Analogy

A head office watches live sales counters, kitchen temperatures, queue lengths and complaint cards from every branch. It does not look at every dish, but it notices instantly when something is off.

i
Control Log Volume

Logging everything is expensive. Filter noisy namespaces and choose retention to match need, using the data collection settings.

21Upgrades and Maintenance

Kubernetes releases new versions regularly, and clusters must keep up.

Kubernetes publishes a new minor version, such as 1.xx, roughly every few months. AKS supports a limited number of recent versions, normally the latest few, and older versions fall out of support after a defined period. Running an unsupported version means missing security fixes and losing official help. A long-term support option exists for selected versions in the Premium tier for teams who need slower change. Always check the AKS release calendar for the current support windows.

1

Control plane upgrade

Microsoft upgrades the managed brain when you request a version change. Move one minor version at a time.

2

Node pool upgrade

Nodes are replaced gradually using a surge of extra temporary nodes: new nodes are added, old ones are drained of pods and removed. Pod disruption budgets keep your service available.

3

Node image updates

Security patches for the node operating system arrive as new node images. Automatic upgrade channels can apply them.

4

Planned maintenance windows

You choose the times when automatic upgrades may happen, such as quiet nights.

5

Test first

Upgrade a non-production cluster first, since removed or changed interfaces in new versions can break old manifests.

Simple Analogy

Upgrading is like renovating a busy restaurant one kitchen at a time. New staff arrive first, old ones are retired only after their orders are finished, and the dining room never closes.

!
Common Mistake

Ignoring upgrades for a year, then trying to leap through several versions under pressure. Smaller regular upgrades are safer than rare huge ones.

22Reliability, High Availability and Disaster Recovery

Plan for failures at every level, from a pod to an entire region.

1

Pod level

Run several replicas, use probes, and set pod disruption budgets.

2

Node level

Use several nodes, autoscaling and automatic repair.

3

Zone level

Spread node pools across availability zones and use topology spread rules, so a single data center failure leaves capacity running.

4

Control plane level

The Standard tier offers a financially backed uptime SLA, and a zone-redundant control plane where available.

5

Region level

For critical systems, run a second cluster in another region, route traffic with a global service such as Azure Front Door or Traffic Manager, and replicate data.

Recovery

Rebuild from Git

If all cluster configuration is in Git, a lost cluster can be recreated and the applications redeployed quickly.

Recovery

Back up state

Use AKS backup or tools such as Velero for volumes and cluster resources, and test restores regularly.

Recovery

Data stores outside the cluster

Managed databases with geo-replication simplify disaster recovery.

Simple Analogy

A restaurant chain survives a single broken oven (pod), a burnt kitchen (node), a flooded street (zone) and even a city-wide blackout (region) by having spare equipment, spare kitchens, spare locations and written recipes stored at head office.

23Cost Management for AKS

AKS makes it easy to scale, and just as easy to overspend.

You pay for the nodes (virtual machines, disks), networking components such as load balancers, public addresses and outbound data, storage, monitoring data, and the paid cluster tier if you choose Standard or Premium. The control plane in the Free tier has no charge.

Saver

Right-size requests

Overstated requests make nodes look full and force extra machines. Adjust using real usage data.

Saver

Autoscale in both directions

Let the cluster shrink at night and weekends, and scale non-production clusters to zero or stop them when idle.

Saver

Use Spot pools for tolerant work

Batch jobs and test workloads can use deeply discounted capacity.

Saver

Commit to the stable base

Reservations or savings plans reduce the price of always-on nodes.

Saver

Reduce logging waste

Filter noisy logs and choose suitable retention.

Saver

Track cost by namespace

Cost analysis features and labels show which teams use the most, encouraging responsible use.

Simple Analogy

Opening extra kitchens during a rush is wise, but leaving them open all night with no customers is wasteful. Good managers match open kitchens to real demand and review the cost per branch each month.

i
Use the Calculator and Cost Management

Estimate with the Azure pricing calculator before building, then track real cost in Cost Management and set budgets with alerts.

24Design Patterns and Anti-Patterns

Proven ways of organizing applications on Kubernetes, and habits to avoid.

Pattern

Sidecar

A helper container running beside the main one in the same pod, for logging, proxying or security, without changing the main application.

Pattern

Init container

A short setup task that must finish before the main container starts, such as preparing files.

Pattern

Blue-green and canary releases

Run old and new versions side by side and shift traffic gradually.

Pattern

Namespace per team or environment

With quotas and policies, giving each group its own safe space.

Pattern

Landing zone cluster

A standard, governed base design that all teams reuse, with networking, identity and monitoring already in place.

Pattern

Service mesh when needed

An optional layer, such as the Istio-based add-on, giving encryption between services, traffic control and rich telemetry. Add it only when the complexity is justified.

ANTI-PATTERN-01 Avoid
Problem

A team adopts Kubernetes for a single small application with one developer and low traffic.

Why It’s Harmful

The complexity of clusters, networking and upgrades far exceeds the benefit, slowing delivery and raising cost.

Correct Approach

Consider simpler platforms such as App Service or Container Apps first. Choose AKS when you truly need its control, scale or ecosystem.

ANTI-PATTERN-02 Avoid
Problem

Engineers change running clusters by hand with direct commands, with no record of what was done.

Why It’s Harmful

Clusters drift from the documented design, mistakes are not reviewed, and recreating the cluster after a failure becomes impossible.

Correct Approach

Keep desired state in Git, apply changes through reviewed pipelines or GitOps, and restrict manual changes.

ANTI-PATTERN-03 Avoid
Problem

Important databases are run inside the cluster by a team without experience in stateful operations, with no tested backups.

Why It’s Harmful

A node failure, upgrade or mistake can lose data, and recovery is slow and uncertain.

Correct Approach

Use managed data services where possible. If running state inside the cluster, use proper operators, zone-aware storage, backups and restore drills.

ANTI-PATTERN-04 Avoid
Problem

One giant shared cluster hosts every team and environment, without quotas, policies or network separation.

Why It’s Harmful

One noisy or compromised workload affects everyone, and no team can upgrade or change safely.

Correct Approach

Separate production from non-production, use namespaces with quotas and policies, and consider separate clusters for strong isolation needs.

25Best Practices Checklist

A compact list to review before and after going to production.

1

Plan the network first

Select the plugin, size address ranges for growth, and decide on private access and outbound control.

2

Use the Standard tier for production

Get the uptime SLA and higher limits, and spread across zones.

3

Separate system and user pools

Keep system components safe from application noise.

4

Set requests, limits, probes and disruption budgets

Every workload should declare what it needs and how to check its health.

5

Use Entra ID, RBAC and workload identity

No shared admin accounts and no stored passwords in pods.

6

Enforce policy and network policies

Guardrails that prevent insecure workloads.

7

Automate with Git and pipelines

Every change is reviewed, repeatable and reversible.

8

Monitor, alert and upgrade regularly

Know the cluster’s health and stay within supported versions.

9

Test failure and recovery

Practice node loss, zone loss and restoring from backup before a real incident.

Simple Analogy

Before opening a new restaurant branch, managers walk through a checklist: fire exits, trained staff, supply deliveries, cash register, health inspection and emergency plans. A cluster deserves the same discipline.

26Advantages, Disadvantages and Alternatives

A balanced view helps you choose the right platform.

Advantages

  • Managed control plane, removing the hardest operational work.
  • Industry-standard Kubernetes, portable skills and a huge ecosystem.
  • Deep integration with Azure identity, networking, storage, monitoring and security.
  • Powerful scaling at pod and node level.
  • Rolling updates, self-healing and strong automation.
  • Choice of control, from Standard to the guided Automatic mode.

Disadvantages

  • Steep learning curve with many concepts and moving parts.
  • You remain responsible for nodes, applications, security settings and upgrades planning.
  • Easy to overspend without governance.
  • Rapid change: versions, features and recommended practices evolve constantly.
  • Early decisions such as network plugin are hard to reverse.
Azure optionBest forTrade-off
Azure App ServiceTypical web apps and APIs with minimal operationsLess control over the runtime environment
Azure Container AppsContainers and microservices with simple scaling, including scale to zeroLess Kubernetes-level control
Azure FunctionsEvent-driven small functionsDifferent programming model
Azure Container InstancesQuick single containers and short tasksNo orchestration features
AKSComplex, large or custom container platforms needing full KubernetesHighest skill and operating effort

A useful rule: choose the simplest platform that meets your needs. Move to AKS when you need Kubernetes capabilities, such as custom networking, many cooperating services, special scheduling, an ecosystem of Kubernetes tools, or portability across environments.

27Real-World Examples

Seeing how organizations use AKS helps connect the concepts.

An online retailer handling sale day

A retailer runs its storefront, basket, payment and search as separate services. Pod autoscaling adds copies as traffic rises, the cluster autoscaler adds nodes, and a ingress controller with a web application firewall protects the entrance. After the sale, everything scales down automatically, and costs drop.

A bank modernizing in careful steps

A bank uses private clusters with API server access only from its internal network, workload identity for database access, strict network policies, Azure Policy guardrails and Defender for Containers. Releases move through GitOps with approvals, and every change is traceable for auditors.

A media company processing videos

A media firm uses a Spot node pool for video encoding jobs triggered by queue messages through KEDA. Jobs scale from zero to hundreds of pods and back to zero, with huge savings compared with always-on servers.

A software company building a platform for its teams

A platform team provides a standard AKS setup with approved networking, monitoring and policies. Product teams get their own namespaces with quotas and deploy through templates, so they ship quickly without learning every cluster detail.

A machine learning team serving models

A team runs a GPU node pool, tainted so only model-serving pods use it. Autoscaling adds GPU nodes only when requests rise, and the nodes disappear when idle, controlling the high cost of GPU machines.

“Kubernetes is not about containers. It is about describing what you want and letting software keep it true.”

28Frequently Asked Questions

Q1What is the difference between Kubernetes and AKS?

Kubernetes is the open-source software. AKS is Azure’s managed service that runs the Kubernetes control plane for you and integrates it with Azure services. You still manage worker nodes, workloads and many settings.

Q2Is the AKS control plane free?

The Free tier does not charge for the control plane but has no financially backed uptime guarantee. The Standard and Premium tiers carry a charge and add guarantees and features. You always pay for nodes and related resources.

Q3Which network plugin should I choose?

Many new clusters use Azure CNI Overlay, or Azure CNI powered by Cilium, for address efficiency and scale. Avoid kubenet for new clusters because of its announced retirement. Always check the current recommendation, and decide before creating the cluster.

Q4When should I use Container Apps or App Service instead?

If your needs are simple, such as a web app or a few microservices with basic scaling, they require much less operating effort. Use AKS when you need Kubernetes features, deeper control or an ecosystem of Kubernetes tools.

Q5How do pods access Azure services securely?

Use workload identity, which lets a pod receive an Entra identity and obtain access tokens without stored passwords. Combine it with Key Vault for secrets and private endpoints for network paths.

Q6How often must I upgrade?

Kubernetes versions are supported for a limited time, so plan regular upgrades, usually a few times a year, and use maintenance windows and auto-upgrade channels. Test in a non-production cluster first.

Q7Can I run databases in AKS?

Yes, using StatefulSets, persistent volumes and database operators, but it demands expertise. For important data, managed database services are usually simpler and safer.

Q8How do I control costs?

Right-size requests, enable autoscaling in both directions, use Spot pools for tolerant work, commit to stable capacity, limit log volume, stop idle non-production clusters and track costs by namespace with budgets and alerts.

Q9Where should I start learning?

Learn containers first, then core objects like pods, deployments and services. Create a small test cluster in a non-production subscription, deploy a simple application, expose it, scale it and observe it. Then add identity, policies, GitOps and monitoring step by step.

29Summary and Key Takeaways

Azure Kubernetes Service gives you the power of Kubernetes while Microsoft operates the control plane. You have learned how containers and Kubernetes solve the problem of running many applications reliably, how an AKS cluster is built from a managed control plane and node pools, and how pods, deployments, services and ingress describe what you run and how traffic reaches it. You have seen how networking, storage, identity and secrets are arranged, how scaling works at pod and node levels, how delivery pipelines and GitOps keep changes safe, and how layered security, monitoring, upgrades, resilience and cost control keep a cluster healthy and affordable.

The best way to start is small and careful: choose the network design deliberately, set resource requests and probes on every workload, use Entra ID and workload identity, store configuration in Git, and watch your cluster with proper monitoring and budgets. Kubernetes rewards teams that automate, measure and keep things simple. Remember that the aim is not to run Kubernetes for its own sake, but to deliver reliable applications to your users with confidence.

Key Takeaways

  • Managed brain, your workloads — AKS runs the control plane, while you manage node pools, applications, networking, access and cost under the shared responsibility model.
  • Desired state is the core idea — you declare what you want in manifests, and control loops keep reality matched, with pods, deployments, services and ingress as the main building blocks.
  • Plan networking early — choose the network plugin and address ranges carefully, favor modern options such as CNI Overlay, and use network policies and private access.
  • Always declare needs and health — set resource requests, limits, probes and disruption budgets so scheduling, scaling and updates behave predictably.
  • Secure in layers — Entra ID, RBAC, workload identity, Key Vault, Azure Policy, image scanning, private API access and Defender for Containers each protect a different layer.
  • Scale and deliver with automation — use pod autoscaling, KEDA and node autoscaling, with Git-based delivery, progressive releases and regular, tested upgrades.
  • Choose the simplest tool that fits — consider App Service or Container Apps first, control cost with right-sizing and budgets, and confirm current versions, tiers and features in the official documentation.