Azure Kubernetes Service (AKS)

Azure Kubernetes Service (AKS)

A beginner-friendly guide to running containerised applications on Azure: what containers and Kubernetes are, how AKS manages the hard parts for you, and how to run clusters safely, reliably, and affordably.

Imagine you have built an application. On your laptop it works perfectly. Then you move it to a server and it breaks, because the server has a different version of some software. Now imagine your application becomes popular, and you need ten copies running, then a hundred, and when one copy crashes, another must start automatically. Doing all of this by hand would be exhausting and error-prone.

Two ideas solve these problems. Containers package an application together with everything it needs, so it runs the same everywhere. Kubernetes is a system that runs and looks after many containers across many computers. Azure Kubernetes Service, or AKS, is Microsoft’s managed version of Kubernetes: Azure runs the difficult control machinery for you, and you focus on your applications.

This guide assumes you know nothing about any of this. Each new word is explained when it first appears, with an everyday comparison and a practical example. By the end you will understand how AKS is built, how traffic, storage, scaling, upgrades, and security work, and how to run it well.

!
Versions, features, and prices change

Kubernetes releases new versions several times a year, and AKS adds, renames, and retires features regularly. This guide teaches the lasting ideas and uses typical figures as examples. Before relying on a specific version, limit, price, or feature status, confirm it in Microsoft’s official AKS documentation.

1The Big Idea: A Managed Fleet Manager for Containers

AKS lets you run many containers across many machines without building and maintaining the management system yourself.

The simple definition

Azure Kubernetes Service is an Azure service that gives you a working Kubernetes cluster. A cluster is a group of computers that act together as one system. In AKS, Azure operates the “brain” of the cluster, and you provide the “workers”, which are virtual machines that run your containers. You tell the cluster what you want, for example “keep five copies of my shopping website running”, and the cluster makes it so and keeps it so.

Analogy

Think of a large delivery company. The packages are the containers. The trucks and drivers are the worker machines. The dispatch office decides which truck takes which package, reroutes work when a truck breaks down, and adds trucks during the holiday rush. In AKS, Azure runs the dispatch office for you, and you supply the trucks and the packages.

What AKS gives you

Managed

Azure runs the brain

The control plane, the part that makes decisions, is created, patched, and kept available by Azure.

Self-healing

Failed containers restart

If a container or a worker machine dies, Kubernetes starts replacements automatically.

Scalable

Grow and shrink

More copies of an application, and more worker machines, can be added or removed to match demand.

Connected

Part of Azure

It works with Azure networking, identity, monitoring, storage, and container registries.

1
managed control plane run by Azure
N
worker machines that you size and scale
∞
copies of an app, within your capacity, kept alive automatically
i
Remember

AKS removes the work of running Kubernetes itself, but not the work of running your applications. You still design, secure, monitor, and pay for what runs inside the cluster.

2First, Containers: Applications in Sealed Boxes

Before Kubernetes makes sense, you need to understand what it manages.

The “works on my machine” problem

An application depends on many things: a programming language runtime, libraries, settings, and a particular version of each. If the server has different versions, the application may fail in strange ways. For years, teams lost days to this problem.

What a container is

A container is a lightweight package that holds an application and everything it needs to run: its code, its libraries, and its settings. It runs in isolation from other containers on the same machine, yet shares the machine’s operating system core, which makes it small and quick to start. A container image is the saved, read-only blueprint, and a running container is a live copy made from an image.

Analogy

A shipping container carries goods anywhere in the world, on any ship, train, or truck, because its size and fittings are standard. The crane does not care what is inside. A software container works the same way: the machine does not care what the application is, only that the package follows the standard.

Containers versus virtual machines

QuestionVirtual machineContainer
What it includesA full operating system plus the appThe app and its libraries only
SizeUsually gigabytesUsually megabytes to a few hundred megabytes
Start timeOften minutesOften seconds or less
IsolationStrong, separate operating systemsGood, shared operating system core
DensityFewer per machineMany per machine
Analogy

A virtual machine is like a separate small house with its own kitchen, plumbing, and wiring. A container is like a room in an apartment building: it has its own door and privacy, but shares the building’s water and electricity.

i
Where images live

Images are stored in a registry, a library of container images. On Azure, the usual choice is Azure Container Registry. A cluster downloads an image from the registry when it needs to start a container.

3Why Kubernetes Exists

One container is easy. A thousand containers across fifty machines is a different problem.

Running one container on one machine is simple. But real systems need many containers, spread across many machines, because one machine is a single point of failure and has limited capacity. Then a long list of questions appears. Which machine should run each container? What if a machine dies? How do containers find each other when their addresses keep changing? How do you update the application without turning it off? How do you add capacity during a busy hour?

Kubernetes, often written K8s, is an open-source system that answers these questions. It was created by Google, based on experience running enormous numbers of containers, and was released to the world through the Cloud Native Computing Foundation. Today it is the standard way to run containers at scale, and every major cloud offers a managed version.

1

Schedule

Decide which machine has room and runs each container.

2

Heal

Replace containers and react when machines fail.

3

Scale

Add or remove copies when demand changes.

4

Connect

Give containers stable addresses and spread traffic among copies.

5

Update

Roll out new versions gradually, and roll back if something is wrong.

Analogy

An orchestra needs a conductor. Each musician plays well alone, but someone must keep the tempo, cue the sections, and cover for an absent player. Kubernetes is the conductor of the containers, which is why its work is called orchestration.

4Why Managed Kubernetes? The Case for AKS

Kubernetes is powerful, but running it yourself is hard work. AKS takes over the hardest parts.

The burden of self-managed Kubernetes

If you install Kubernetes yourself, you must build and protect its control plane, back up its database, patch it, upgrade it carefully every few months, replace failed control machines, and keep it highly available. These tasks need specialist skills and constant attention, and a mistake can take down the whole cluster.

What AKS takes off your plate

  • Creating and running the control plane
  • Keeping the control plane available and patched
  • Providing upgrade tooling for the control plane and nodes
  • Integrating identity, networking, and monitoring with Azure
  • Offering support through Azure channels

What stays your responsibility

  • Choosing sizes and counts of worker machines
  • Applying node and application updates on a sensible schedule
  • Securing your workloads and who can access the cluster
  • Monitoring, scaling rules, and cost control
  • Designing applications that tolerate failure
Analogy

Building your own restaurant kitchen means buying the ovens, wiring the gas, hiring maintenance, and passing inspections. Renting a fully equipped kitchen lets you start cooking sooner, though you still choose the menu, hire the cooks, and keep it clean. AKS is the rented, professionally maintained kitchen.

i
The shared responsibility idea

Cloud services split duties between provider and customer. With AKS, Azure is responsible for the control plane, and you are responsible for nearly everything that runs on or touches your worker nodes and applications. Knowing this line prevents unpleasant surprises.

5Core Kubernetes Vocabulary

Kubernetes has its own vocabulary. This table is the key to everything that follows.

TermWhat it meansEveryday comparison
ClusterThe whole group of machines managed togetherThe delivery company
Control planeThe brain that makes decisions and stores the desired stateThe dispatch office
NodeA worker machine that runs containersA delivery truck
PodThe smallest unit Kubernetes runs; one or more tightly linked containers sharing network and storageA single parcel box, perhaps with a few related items inside
DeploymentAn instruction that keeps a set number of identical pods running and handles updatesA standing order for five identical parcels
ServiceA stable address that spreads traffic to a changing set of podsA shop’s phone number that reaches whoever is on duty
NamespaceA named partition inside a clusterA department floor in a building
LabelA name and value tag attached to objects for groupingA sticker on a box
ConfigMap and SecretStored settings, and stored sensitive settingsA notice board, and a locked drawer
IngressRules for letting outside web traffic reach servicesThe building’s reception desk
VolumeStorage attached to a podA detachable storage box
ManifestA text file describing the objects you wantThe order form

Desired state: the heart of Kubernetes

The most important Kubernetes idea is desired state. You do not tell Kubernetes the steps. You describe what you want, such as “five copies of this web app”. Kubernetes constantly compares what you want with what actually exists, and works to close any gap. If a pod dies, there are only four where you wanted five, so it starts another. This repeating compare-and-fix loop is called reconciliation.

Analogy

A home thermostat is a good picture. You set the temperature you want, and it keeps measuring the real temperature, switching the heater on or off to match. You never say “heat for twelve minutes”. Kubernetes treats your applications the same way.

i
Tip

When something puzzling happens in a cluster, ask two questions: what was the desired state, and what is the actual state? Almost every Kubernetes problem is a gap between the two, and the tools show both.

6AKS Architecture: Two Sides of the Cluster

An AKS cluster has a control plane that Azure runs and worker nodes that run in your subscription.

flowchart TB
  subgraph AZ["Managed by Azure"]
    API["API server: the front door"]
    ET["etcd: the cluster's memory"]
    SC["Scheduler: picks a node for each pod"]
    CM["Controllers: keep reality matching desire"]
    API --- ET
    API --- SC
    API --- CM
  end
  subgraph YOU["In your subscription"]
    N1["Node 1: kubelet and pods"]
    N2["Node 2: kubelet and pods"]
    N3["Node 3: kubelet and pods"]
  end
  U["You: kubectl, portal, pipelines"] --> API
  API --> N1
  API --> N2
  API --> N3
    
The control plane is operated by Azure. The worker nodes are virtual machines in a resource group in your own subscription.

Control plane components

Front door

API server

Every request, from you or from internal parts, goes through this single doorway, where it is checked and processed.

Memory

etcd

A reliable database that stores the cluster’s desired and current state. If it is lost, the cluster forgets what it should be doing.

Placement

Scheduler

Chooses which node should run each new pod, based on available room and rules.

Fixing

Controller manager

Runs the loops that notice gaps between desired and actual state, and close them.

Node components

  • Kubelet: an agent on each node that receives instructions and makes sure the assigned pods run and stay healthy.
  • Container runtime: the software that actually starts and stops containers on the node.
  • Network proxy and rules: handle the traffic rules that make services reachable.
Analogy

The API server is the reception desk, etcd is the filing cabinet, the scheduler is the person who assigns tasks to teams, and the controllers are supervisors who walk the floor checking that the work matches the plan. On each truck, the kubelet is the driver who follows dispatch’s instructions.

i
What you do not see

In AKS you cannot log into the control plane machines. Azure hides them on purpose, and that is exactly what removes the maintenance burden. You interact only through the API server.

7The Managed Control Plane in Detail

Azure keeps the brain of your cluster alive, and offers different levels of commitment about how reliable it is.

What Azure does for you

When you create a cluster, Azure sets up the control plane components in a way that you do not have to manage. Azure monitors them, repairs them, patches them, and applies updates when you ask to upgrade the Kubernetes version. The control plane uses redundancy so that the failure of one component does not stop the cluster from accepting requests.

Pricing tiers and reliability promises

AKS has offered more than one tier for the control plane, which differ in cost and in the reliability commitment. In broad terms, a free tier is meant for learning and testing, with no financial commitment on availability. A standard tier adds a financially backed uptime commitment and is meant for production, and a premium tier adds long-term support options for organisations that need to stay on a particular Kubernetes version for longer. The names, prices, and details change over time, so check current documentation before choosing.

TierIntended useTypical idea
FreeLearning, experiments, small testsControl plane at no charge, no uptime commitment
StandardProduction workloadsPaid, with a stronger availability commitment and support for larger clusters
PremiumStrict version and support needsEverything in Standard plus extended support options
Analogy

It is like choosing between a basic public library card, a standard membership with guaranteed opening hours, and a premium membership with extra services. All let you borrow books, but they differ in the promises made to you.

!
Verify before you choose

Tier names, prices, uptime percentages, and cluster-size limits are updated by Microsoft. Treat everything above as the shape of the choice, not as current figures.

8Nodes and Node Pools: Your Fleet of Workers

The worker machines in AKS are organised into groups called node pools.

What a node pool is

A node pool is a group of identical worker nodes. All nodes in a pool share the same virtual machine size, operating system type, and settings. A cluster has at least one pool, and can have many. Behind the scenes, Azure creates a scale set for each pool, which is the Azure feature that manages a group of identical machines.

System

System node pool

Runs the cluster’s own essential pods, such as DNS. Every cluster needs at least one. Keep it small, stable, and separate from busy workloads.

User

User node pools

Run your applications. You can have several, each shaped for a purpose, such as memory-heavy, CPU-heavy, or with graphics processors.

Spot

Spot node pools

Use spare Azure capacity at a big discount, but Azure can take the machines back at short notice. Good for work that can be interrupted.

OS

Linux and Windows pools

Most workloads use Linux, while Windows pools exist for applications that need Windows containers.

Analogy

A delivery company keeps different kinds of vehicles: small vans for city parcels, big lorries for heavy cargo, and refrigerated trucks for food. Each type is a pool. Dispatch sends each parcel to the right type, and you can add more of one kind without touching the others.

Choosing machine sizes

Virtual machine sizes differ in how many processor cores and how much memory they have. Choose by watching real usage, not guessing. Very small nodes waste capacity on system overhead, while very large nodes make a single node failure hurt more. A middle path, a handful of moderate-sized nodes per pool, is common for production.

i
Tip

Use taints and tolerations, explained later, to keep ordinary applications off the system pool and keep special workloads on their specialised pools.

9Pods, Deployments, and the Life of an Application

Follow an application from your instruction to running containers, and through an update.

sequenceDiagram
  participant U as You
  participant A as API server
  participant E as etcd
  participant C as Controllers
  participant S as Scheduler
  participant K as Kubelet on a node
  U->>A: Submit a deployment of 3 copies
  A->>E: Store the desired state
  C->>A: Notice 0 pods exist, need 3
  C->>A: Create 3 pod records
  S->>A: Assign each pod to a node
  K->>A: Watch for pods assigned to me
  K->>K: Pull image and start containers
  K->>A: Report pod running
  A->>E: Store the actual state
    
Components never call one another directly. They all read and write through the API server, which makes the system loosely coupled and resilient.

Pods

A pod is the smallest thing Kubernetes runs. Usually it holds a single container, but it may hold a few that must work closely together, sharing the same network address and storage. Pods are disposable. They are never repaired. A broken pod is replaced with a new one, which will have a different address.

Deployments and rolling updates

You rarely create pods directly. A deployment declares how many identical pods you want and which image they run. When you change the image to a new version, the deployment performs a rolling update: it starts a few new pods, waits until they are healthy, shuts down a few old ones, and repeats until all pods are new. Users see no interruption, and if the new version is faulty, the deployment can roll back to the earlier one.

1

Start some new pods

A small number of new-version pods are created alongside the old ones.

2

Wait for health

Kubernetes sends traffic to them only after they report ready.

3

Retire old pods

An equal number of old pods are shut down gracefully.

4

Repeat or roll back

The cycle repeats until finished. If new pods fail to become healthy, the rollout stops.

Analogy

Replacing the staff at a busy shop without closing it: new staff arrive and shadow the old ones, and only once the new person is comfortable does the old person go home. Customers never find the counter empty.

Health checks

  • Readiness check: tells Kubernetes whether a pod is ready to receive traffic. A pod that is still warming up is kept out of rotation.
  • Liveness check: tells Kubernetes whether a pod is stuck. A pod that fails is restarted.
  • Startup check: gives slow-starting applications extra time before the other checks begin.

10Resources, Requests, and Limits: Sharing the Trucks Fairly

Every pod should say how much processing power and memory it needs. This one habit prevents many outages.

Requests and limits

A request is the amount of processor and memory a pod asks Kubernetes to reserve for it. The scheduler uses requests to decide whether a node has room. A limit is the maximum a pod is allowed to use. If a container tries to use more memory than its limit, it is stopped and restarted. If it tries to use more processor than its limit, it is slowed down.

Analogy

Booking seats on a bus: the request is the number of seats you reserve, so there is guaranteed room for you. The limit is the most seats you may spread into if the bus is empty. Without reservations, the bus gets overcrowded and some passengers are thrown off at the next stop.

SituationWhat happens
No requests setThe scheduler cannot plan well, and nodes may be overloaded
Requests far too highNodes look full while they are actually idle, so you pay for waste
Requests far too lowToo many pods land on one node, causing slowness and evictions
Memory limit too lowThe container is repeatedly killed when it needs more memory

Quality of service classes

Based on how you set requests and limits, Kubernetes ranks pods when a node runs out of memory. Pods with requests equal to limits are the most protected, pods with some requests are in the middle, and pods with none are removed first. This ranking decides who gets evicted when the node is under pressure.

!
A frequent beginner mistake

Leaving requests and limits unset because “it works in testing”. Under real load, one greedy pod can starve its neighbours. Set realistic values from measured use, and review them as the application changes.

11Networking Basics: How Pods Talk

Networking is the part of Kubernetes that surprises beginners most. The ideas are simple once you see the pattern.

The basic rules

Kubernetes sets a few simple rules. Every pod gets its own network address. Any pod can reach any other pod directly, without translation, unless you add rules to forbid it. And nodes can reach pods, and pods can reach nodes. How these rules are made to work depends on the network plugin chosen when the cluster is created.

Network models in AKS

ModelHow pods get addressesTypical fit
Overlay networkingPods get addresses from a private range separate from your virtual network, and traffic is wrapped across nodesLarge clusters and when virtual network address space is scarce
Flat networking with Azure CNIPods get addresses directly from your virtual network subnetWhen pods must be reachable directly from other Azure or on-premises systems
Older basic model (kubenet)Pods use a separate range, with route tables managing pathsOlder clusters. Microsoft has been steering new clusters toward newer options, so check current status
Analogy

Imagine a large office building. In a flat model, every employee has a desk phone number from the city’s public numbering plan, so anyone in the city can dial them directly, but numbers run out quickly. In an overlay model, employees have internal extensions, and only the reception desk talks to the outside. Extensions are plentiful, but outsiders need to go through reception.

!
Plan addresses early

The network model and address ranges are among the hardest things to change after a cluster exists. Before creating production clusters, plan how many pods and nodes you will have, and choose address ranges that do not overlap with other networks you may connect to.

i
Tip

Draw the network on paper first: virtual network, subnets, pod range, service range, and any connections to other networks. Overlapping ranges are a frequent source of painful rebuilds.

12Services, Load Balancers, and Ingress

Pods come and go, so Kubernetes provides stable addresses and doors for traffic.

Why services exist

Because pods are replaced often and each new pod has a new address, nobody can depend on a pod’s address. A service solves this with a stable name and address that stays the same, and forwards traffic to whichever healthy pods currently match its label. Other applications inside the cluster simply call the service by name.

Inside

ClusterIP service

A stable address reachable only inside the cluster. The default, and best for internal communication.

Outside

LoadBalancer service

Asks Azure to create a load balancer with a public or private address that sends traffic into the service.

Web

Ingress

Smart rules for web traffic: route by hostname or path, and handle encryption certificates, all through a single entry point.

Gateway

Gateway API and application gateways

Newer and more powerful ways to describe how outside traffic enters, often backed by Azure application gateway products. Check current options.

flowchart LR
  U["Users on the internet"] --> LB["Azure load balancer or gateway"]
  LB --> IC["Ingress controller pods"]
  IC -->|"Path: /shop"| S1["Shop service"]
  IC -->|"Path: /pay"| S2["Payment service"]
  S1 --> P1["Shop pod"]
  S1 --> P2["Shop pod"]
  S2 --> P3["Payment pod"]
  S2 --> P4["Payment pod"]
    
One public entry point serves many applications. The ingress controller reads the rules, and each service spreads traffic across its healthy pods.
Analogy

A service is the shop’s main phone number: customers always dial it, and the call goes to whichever assistant is free. Ingress is the receptionist at a large complex, who hears “I need accounting” or “I need sales” and sends the visitor to the right floor, so the complex needs only one front door.

DNS inside the cluster

Kubernetes runs its own name system, so a pod can reach another application just by using the service name, for example “payments”. The cluster translates the name to the current stable address. This is why applications in a cluster rarely need to know any real network addresses.

13Network Policies and Traffic Control

By default every pod can talk to every pod. Network policies let you close doors that should be closed.

The open default is convenient but not safe. If an attacker breaks into one pod, they could probe all others. A network policy is a rule that says which pods may talk to which, and over what ports. With policies in place, a front-end pod might be allowed to call the back-end, the back-end allowed to call the database, but the front-end forbidden from ever reaching the database directly.

flowchart LR
  F["Front-end pods"] -->|allowed| B["Back-end pods"]
  B -->|allowed| D["Database pods"]
  F -. blocked .-> D
  X["Unrelated pods"] -. blocked .-> D
    
A policy keeps the database reachable only from the back-end, even though all pods share one cluster network.
Analogy

In a hospital, a visitor cannot walk into the pharmacy store or the operating theatre just because they are inside the building. Doors have locks, and only authorised staff have the keys. Network policies are those internal locks.

Practical tips

  • Start with a “deny all” rule per namespace, then allow only the paths that are needed.
  • Control outgoing traffic too, so a compromised pod cannot freely call out to unknown places.
  • Choose a network policy engine when creating the cluster, because support depends on the plugin and engine chosen.
  • Test policies in a non-production namespace first, because a mistake can break legitimate traffic.
i
Tip

Label your pods consistently, with names such as app, tier, and team. Network policies, services, and monitoring all use labels, so good labels pay off many times.

14Storage: Keeping Data Beyond a Pod’s Life

Pods are disposable, but data often must not be. Kubernetes separates the storage from the pod.

The problem

When a pod is deleted or replaced, anything it wrote inside its own container is lost. That is fine for stateless web servers, but not for a database. Kubernetes solves this with persistent volumes, storage that exists independently of any pod and can be reattached to a replacement pod.

The pieces

PiecePurposeEveryday comparison
Persistent volumeAn actual piece of storage in the clusterA storage unit
Persistent volume claimA pod’s request for storage of a certain size and typeA rental request form
Storage classA recipe for creating storage automatically, such as fast or cheapThe menu of storage unit types
DriverThe plug-in that talks to the real Azure storage serviceThe translator

Azure storage choices

Block

Azure Disks

Fast block storage attached to one node at a time. Good for databases and single-pod storage.

Files

Azure Files

A shared file system many pods can read and write at once, useful for shared content.

Objects

Blob storage mounting

Lets pods read large amounts of unstructured data stored as blobs, often for analytics or media.

Scratch

Temporary and local storage

Fast, short-lived storage on the node. Good for caches. It disappears with the node.

Analogy

A pod is like a hotel room guest. When the guest leaves, the room is cleaned and anything left inside is thrown away. A persistent volume is a safe-deposit box in the bank: the guest can check out of one room and check in to another, and the box still holds their valuables.

!
State is the hard part

Running databases inside Kubernetes is possible but demanding. Many teams prefer managed Azure database services for important data, and keep the cluster for stateless application code. Decide deliberately, and always have tested backups.

i
Zones and disks

A disk lives in one availability zone. A pod using it must run in the same zone, so plan zone placement carefully when you rely on disks, and consider storage types with zone redundancy.

15Configuration and Secrets

Keep settings out of your images so one image can run everywhere.

The same container image should run in testing and in production, with only the settings differing. Kubernetes provides two objects for this. A ConfigMap stores ordinary settings, such as a feature switch or a web address. A Secret stores sensitive values, such as passwords. Pods receive them as environment variables or as files.

Analogy

A chef uses the same recipe in every branch, but each branch has its own supplier list on the notice board. The recipe, which is the image, never changes. The notice board, which is the configuration, does.

!
Secrets are not automatically safe

A basic Kubernetes secret is only encoded, not strongly protected, and anyone with enough access to the cluster can read it. For serious protection, store secrets in Azure Key Vault and let pods fetch them through a secure integration, and restrict who can read secrets in the cluster.

Good habits

  • Never bake passwords or keys into container images.
  • Keep configuration in files under version control, separate from secret values.
  • Use a Key Vault integration so secrets rotate without rebuilding images.
  • Give each namespace only the secrets it needs.

16Scaling: Matching Capacity to Demand

AKS can grow and shrink at two levels: the number of pods, and the number of nodes.

flowchart TD
  L["Load rises"] --> H["Horizontal pod autoscaler adds pods"]
  H --> Q{"Is there room on existing nodes?"}
  Q -->|Yes| R["New pods start"]
  Q -->|No| P["Pods wait as pending"]
  P --> CA["Cluster autoscaler adds nodes"]
  CA --> R
  R --> D["Load falls"]
  D --> S["Pods scale in, idle nodes are removed"]
    
Pod scaling reacts first. If nodes are full, node scaling follows. When demand drops, both shrink to save money.
Pods

Horizontal pod autoscaler

Adds or removes pod copies based on measurements such as processor use, memory, or custom numbers.

Nodes

Cluster autoscaler

Adds worker machines when pods cannot be placed, and removes underused ones.

Events

Event-driven scaling

Tools such as KEDA scale pods by outside signals, like the length of a message queue, and can scale to zero when idle.

Size

Vertical pod autoscaler

Suggests or adjusts the requests of pods to fit real usage, rather than adding more copies.

Smart

Automatic node provisioning

Newer approaches choose suitable machine types on demand instead of fixed pools. Feature status changes, so check current documentation.

Analogy

A supermarket opens more checkout counters as the queue grows, which is pod scaling. If all counters are in use and the queue is still growing, the manager calls in extra staff to open new counters, which is node scaling. When quiet, the extra staff go home.

Making scaling work well

  • Set requests honestly. Autoscalers use them for decisions, so wrong requests give wrong scaling.
  • Set minimums and maximums. A minimum protects availability, and a maximum protects your bill.
  • Allow warm-up time. New nodes take a few minutes to arrive, so scale early rather than late for sudden spikes.
  • Test with load. Never discover scaling behaviour on launch day.
i
Tip

Autoscaling cannot fix an application that cannot run in several copies at once. Design stateless services first, and keep shared state in a database or cache.

17Scheduling Controls: Deciding Who Runs Where

Sometimes you need to guide the scheduler. Kubernetes gives you several polite and strict controls.

ControlWhat it doesEveryday comparison
Node selector and node affinityPrefer or require nodes with certain labels“This parcel must go on a refrigerated truck”
Taints and tolerationsA taint repels pods from a node unless the pod tolerates itA “staff only” sign on a door
Pod anti-affinityKeep copies of the same app on different nodes or zonesNever putting all eggs in one basket
Topology spread constraintsSpread pods evenly across zones or nodesDistributing guests evenly among tables
Priority classesMark some pods as more important, so they win when room is shortEmergency patients first in a queue
Pod disruption budgetsLimit how many copies may be down during planned maintenanceNever letting more than one lift be serviced at a time
Analogy

Seating at a wedding: you want families spread around so that no single table losing power ruins the party, VIPs near the front, and some tables reserved for special guests. These controls are the seating chart for your pods.

i
Why pod disruption budgets matter

During node upgrades, nodes are drained one by one. Without a disruption budget, Kubernetes may take down several copies of your application at once. A budget tells it to wait until enough healthy copies exist elsewhere.

18Upgrades and Maintenance

Kubernetes moves quickly. Staying current safely is a core part of running AKS.

Versions

Kubernetes publishes a new minor version a few times a year, and each version is supported for a limited window. AKS supports a rolling set of recent versions, and older ones stop receiving fixes. Running an unsupported version means no security patches and possibly no help. Plan to upgrade regularly rather than waiting until the last moment.

Two kinds of updates

Kubernetes

Version upgrades

Move the control plane and then the node pools to a newer Kubernetes version. Done on your schedule, one pool at a time.

Operating system

Node image updates

Replace nodes with images containing the newest operating system patches. Can be automated through channels and maintenance windows.

How a node upgrade works

1

Add a surge node

An extra node with the new version is created, so capacity does not dip.

2

Cordon and drain an old node

The old node stops accepting new pods, and its pods are moved elsewhere gracefully, respecting disruption budgets.

3

Replace it

The old node is removed, and the process repeats for the next node.

4

Verify

Check that pods are healthy and the application behaves normally.

Analogy

Servicing a fleet of buses without stopping the timetable: bring in a spare bus, move passengers from one bus to the spare, service the empty bus, then rotate to the next. Passengers barely notice.

!
Check for removed features

Each Kubernetes version may remove old programming interfaces. Applications and tools that use them can break after an upgrade. Read the release notes, scan your manifests, and rehearse in a test cluster first.

i
Use maintenance windows

Define planned maintenance windows so automatic updates happen at quiet hours and not in the middle of your busiest day.

19Identity and Access: Who Can Do What

There are two sets of questions: who may manage the cluster, and what may your applications access?

Access for people

AKS integrates with Microsoft Entra ID, Azure’s identity service, so people sign in with their normal work accounts instead of shared cluster passwords. Two layers of permission then apply. Azure role-based access control decides who may create, change, or delete the cluster itself. Kubernetes role-based access control decides what a signed-in person may do inside the cluster, such as reading pods in one namespace but not deleting them. Azure also offers a way to manage Kubernetes permissions using Azure roles, so one system of records covers both.

Analogy

Think of an office complex. The outer security desk decides who may enter the compound at all, which is the Azure layer. Inside, key cards decide which floors and rooms each person may use, which is the Kubernetes layer.

Access for applications

Applications in pods often need to call Azure services, such as a database or a vault. Putting passwords in the pod is risky. Workload identity lets a pod prove who it is using a short-lived token tied to a service account, and Azure grants access based on that identity. There are no stored passwords to leak, and access can be limited to the exact pod that needs it. Older approaches existed, and the recommended approach has changed over time, so follow the current guidance.

sequenceDiagram
  participant P as Pod
  participant K as Cluster token issuer
  participant E as Microsoft Entra ID
  participant V as Azure service
  P->>K: Ask for a signed identity token
  K-->>P: Short-lived token for this service account
  P->>E: Exchange token for an Azure access token
  E-->>P: Access token limited to allowed services
  P->>V: Call service with access token
  V-->>P: Response
    
The pod never holds a password. It exchanges a short-lived cluster token for an Azure token.
i
Least privilege

Give people and pods the smallest permissions they need, in the smallest scope. Use groups rather than individuals, review access regularly, and use time-limited elevation for administrators.

20Security: Layers of Protection

Kubernetes security works best as layers, so one failure does not mean total loss.

flowchart TB
  A["Layer 1: Supply chain - trusted, scanned images"] --> B["Layer 2: Cluster access - identity, roles, private endpoint"]
  B --> C["Layer 3: Network - policies, firewalls, private traffic"]
  C --> D["Layer 4: Workload - restricted pods, no unnecessary privileges"]
  D --> E["Layer 5: Data - secrets in a vault, encryption"]
  E --> F["Layer 6: Detection - logs, alerts, threat protection"]
    
Each layer assumes the one before it might fail. Together they make an attack harder and easier to notice.

Layer by layer

Images and the supply chain

Build images from trusted, minimal base images. Scan for known vulnerabilities, keep images in a private registry, and allow only approved registries to be used in the cluster. Prefer specific image versions over a floating “latest” tag so you know exactly what runs.

Cluster access

Use Entra sign-in, disable shared local administrator accounts where possible, and limit who can reach the API server. A private cluster gives the API server a private address, so it is not exposed to the public internet. You can also restrict the API server to approved address ranges.

Workload hardening

Run containers as non-root users, drop unneeded capabilities, use read-only file systems where possible, and apply pod security standards. Use Azure Policy for Kubernetes to enforce these rules automatically, blocking deployments that break them.

Network control

Use network policies between pods. Control outbound traffic through a firewall so that pods can reach only approved destinations. Encrypt traffic in transit, and consider a service mesh when you need encrypted pod-to-pod communication and fine-grained traffic rules.

Data protection

Keep secrets in Key Vault. Use encryption at rest for disks, and consider customer-managed keys when rules require it.

Detection and response

Enable threat detection such as Microsoft Defender for Containers, collect audit logs of API server actions, and alert on suspicious patterns such as unexpected privileged pods.

Analogy

A castle does not rely on a single wall. It has a moat, a drawbridge, walls, guards, locked rooms, and a watchtower. If one fails, the others still protect the treasure, and the watchtower raises the alarm.

!
Shared responsibility

Azure secures the control plane infrastructure, but nodes, workloads, access rules, and images are largely your responsibility. A secure platform does not make an insecure application safe.

21Monitoring, Logging, and Troubleshooting

You cannot fix what you cannot see. Observability is the habit of making the cluster tell you how it is doing.

The three signals

Numbers

Metrics

Measurements over time, such as processor use, memory, request rates, and error counts.

Text

Logs

Written records of events from containers, nodes, and the control plane.

Journeys

Traces

The path of one request across many services, showing where time is spent.

Azure tools

ToolWhat it provides
Container insights with Azure MonitorCollects container logs and performance data, with ready-made views
Managed PrometheusA managed service for collecting metrics in the popular Prometheus format
Managed GrafanaDashboards that display the metrics
Control plane logsAudit and diagnostic logs from the API server and other control components
Application tracing toolsRequest tracing and application performance data
AlertsNotifications when numbers cross thresholds

What to watch

  • Node health: processor, memory, disk, and node readiness.
  • Pod health: restarts, pending pods, and containers killed for memory.
  • Application signals: request rate, errors, and delay.
  • Scaling: whether autoscalers hit their maximums.
  • Cost signals: idle capacity and over-sized requests.

A first-aid sequence

1

Is the pod running?

Look at its status. Pending means no room or a placement rule problem. Crash loops mean the container keeps failing.

2

Read the events

Kubernetes records reasons such as failing to pull an image, failing health checks, or lacking resources.

3

Read the logs

The container’s own logs often name the cause directly.

4

Check the service and network

Confirm the service finds the pods, and that no policy blocks the path.

5

Check the node

Look for node pressure, disk shortage, or node-level failures.

Analogy

A doctor checks vital signs first, asks about symptoms, reads the chart, and only then orders deeper tests. Metrics are the vital signs, events are the symptoms, and logs are the chart. Working in that order resolves most problems quickly.

i
Common pod states

A pod stuck in “Pending” has not been placed, “ImagePullBackOff” cannot download its image, “CrashLoopBackOff” starts and keeps failing, and “OOMKilled” ran out of memory. Learning these four names solves a surprising share of everyday problems.

22Reliability: Zones, Regions, and Failure

Things fail. A reliable AKS design expects failure and keeps serving users anyway.

Levels of failure

What failsTypical protection
A container or podDeployments restart and replace it; health checks detect it
A nodePods are rescheduled to other nodes; several nodes per pool
A whole datacentre zoneSpread node pools and pods across availability zones
An entire Azure regionA second cluster in another region with traffic steering and data replication
A bad releaseRolling updates, staged rollouts, and quick rollback
A human mistakeCode review, policy guardrails, and backups

Availability zones

An Azure region is divided into availability zones, physically separate datacentres with independent power and cooling. An AKS node pool can spread its nodes across zones. If one zone fails, nodes in the others keep running, and Kubernetes places replacement pods there. Combine this with topology spread rules so copies of your application are spread across zones, and check that your storage and databases are zone-aware too.

flowchart LR
  U["Users"] --> G["Global traffic steering"]
  G --> R1["Region A cluster"]
  G --> R2["Region B cluster"]
  subgraph R1S["Region A"]
    R1 --> Z1["Zone 1 nodes"]
    R1 --> Z2["Zone 2 nodes"]
    R1 --> Z3["Zone 3 nodes"]
  end
  R1 --> DB["Replicated data service"]
  R2 --> DB
    
Zones protect against a datacentre failure inside a region. A second region protects against a regional problem, at greater cost and complexity.
Analogy

A bank with several branches in one city survives a power cut at one branch because customers go to another. A bank with branches in two cities also survives a city-wide flood. Zones are the branches in one city, and regions are branches in different cities.

Multi-region: do you really need it?

Running active clusters in two regions doubles many costs and complicates data consistency, deployments, and testing. Many applications reach their reliability goals with zones alone, and add a second region only when the business impact of a regional outage justifies it. Decide using explicit targets: how much downtime and how much data loss can the business accept?

i
Backups and rebuilds

Treat clusters as replaceable. Keep manifests and infrastructure in code so a cluster can be rebuilt, and back up persistent data separately and test restoring it. A backup you have never restored is only a hope.

23Cost: Paying for What You Need

Kubernetes makes it easy to start things and just as easy to forget them. Cost control is a daily habit.

What you pay for

  • Worker nodes: usually the largest cost. You pay for the virtual machines whether pods fill them or not.
  • Control plane: free in the basic tier, and a small charge in paid tiers, depending on current pricing.
  • Storage: disks and file shares, including unused ones left behind.
  • Networking: load balancers, public addresses, and data leaving Azure or crossing zones and regions.
  • Monitoring: log and metric volume can become significant if collected without thought.
  • Registry and security tools: container registry storage and protection plans.
Savings

Right-size requests

Pods that reserve far more than they use make nodes look full. Fix requests to reduce node count.

Savings

Use autoscaling

Let pods and nodes shrink at night and weekends when traffic falls.

Savings

Spot nodes for tolerant work

Batch jobs and test workloads can use heavily discounted machines that Azure may reclaim.

Savings

Reserved capacity and savings plans

Committing to steady usage for a year or more usually brings lower prices for always-on nodes.

Savings

Stop idle clusters

Development clusters can be stopped outside working hours, which pauses node charges.

Visibility

Tag and allocate

Use labels, namespaces, and tags to see which team or product causes which cost.

Analogy

Running a cluster is like renting a fleet of delivery vans by the hour. Half-empty vans still cost full price. Packing parcels tightly, returning vans when quiet, and renting cheaper vans for non-urgent deliveries all lower the bill without hurting customers.

!
Check current prices

Prices, tiers, and discount programs change. Use the Azure pricing calculator and your own billing data to estimate costs, and set budgets with alerts early.

24Delivery: CI/CD and GitOps

How code travels from a developer’s laptop to a running pod, safely and repeatably.

Continuous integration and delivery

Continuous integration means that every code change is automatically built and tested. Continuous delivery extends this to automatically preparing, and often deploying, the tested result. For AKS this typically means: build a container image, scan it, push it to the registry, and update the cluster to use the new image.

flowchart LR
  A["Developer pushes code"] --> B["Pipeline builds and tests"]
  B --> C["Image scanned and signed"]
  C --> D["Image pushed to registry"]
  D --> E["Manifest repository updated"]
  E --> F["GitOps agent in cluster notices change"]
  F --> G["Cluster pulls new image and rolls out"]
  G --> H["Monitoring watches the release"]
    
In the GitOps style, the cluster itself pulls its desired state from a Git repository instead of being pushed to from outside.

GitOps

GitOps keeps the desired state of the cluster in a Git repository. An agent running inside the cluster continuously compares the cluster with the repository and corrects any difference. Changes happen only by changing the repository, which gives review, history, and easy rollback. AKS supports GitOps through extensions, and popular tools include Flux and Argo CD.

Benefits of GitOps

  • Every change is reviewed and recorded
  • Rollback is as simple as reverting a commit
  • The cluster corrects manual drift automatically
  • Pipelines need no direct power over the cluster, which reduces credential exposure

Things to manage

  • Another tool to learn and operate
  • Secrets need careful handling, since the repository is not a safe place for them
  • Debugging requires following changes through the repository

Safer rollout strategies

Default

Rolling update

Replace pods gradually, as described earlier. Simple, with no extra tools.

Stage

Blue and green

Run old and new versions side by side, then switch traffic all at once, with the old version kept ready for instant return.

Test

Canary

Send a small share of real traffic to the new version first, and increase gradually if the numbers look healthy.

Analogy

A canary rollout is like a restaurant trying a new dish on a few tables before adding it to the whole menu. If diners complain, the dish is quietly removed with little damage. Only when the early tables are happy does it go to everyone.

25Infrastructure as Code and Cluster Setup

A cluster created by clicking is hard to repeat. A cluster described in code can be rebuilt in minutes.

Because AKS is an Azure resource, you can describe it with the same tools used for other Azure resources: Bicep, Azure Resource Manager templates, or Terraform. The code states the Kubernetes version, node pools, network model, identity settings, and add-ons. Storing it in version control gives history, review, and repeatability.

Choices to make when creating a cluster

DecisionWhy it matters
Control plane tierAffects reliability promise and cost
Network model and address rangesHard to change later; affects scale and connectivity
Private or public API serverControls exposure to the internet
Identity integrationDecides how people and workloads authenticate
Node pool layout and zonesAffects resilience, cost, and workload placement
Upgrade channel and maintenance windowControls how updates reach the cluster
Monitoring and security add-onsProvide visibility and protection from day one
Policy and guardrailsEnforce standards for every team

Opinionated, simplified modes

Microsoft has introduced a more automated style of cluster, often called AKS Automatic, where many of these decisions are made for you using recommended settings, including node management, scaling, networking, and security defaults. This reduces effort and mistakes, in exchange for less freedom to tune. Whether it suits you depends on your need for control. Because this area evolves quickly, check the current documentation.

Analogy

Buying a car, you can choose a manual workshop-built model where you pick every part, or an automatic model with sensible defaults that drives well immediately. Experts may want the first. Most daily drivers are happier with the second.

i
Landing zones

Large organisations create a standard, governed environment, called a landing zone, with network, policies, and access already prepared. New clusters then fit into a safe, consistent base rather than each team inventing its own.

26Trade-offs: Is AKS the Right Tool?

AKS is powerful, but power brings complexity. Choose it for good reasons.

OptionBest forControlOperational effort
Virtual machinesTraditional apps and full control of the systemHighestHigh
App ServiceStandard web apps and APIs with minimal effortLowVery low
Azure FunctionsSmall event-driven pieces of codeLowVery low
Azure Container AppsContainers and microservices without managing Kubernetes directlyMediumLow
AKSComplex container platforms needing the full Kubernetes ecosystem and controlHighMedium to high
Self-managed KubernetesUnusual needs not met by managed servicesHighestVery high

Choose AKS when

  • You have many services that need fine control over networking, scaling, and placement
  • Your team knows Kubernetes or is willing to invest in learning it
  • You want portability, because Kubernetes works across clouds and on-premises
  • You need the huge ecosystem of Kubernetes tools
  • You run mixed workloads, including batch, machine learning, and web services

Think twice when

  • You have one or two simple applications
  • The team is small and has no Kubernetes experience
  • A simpler service such as App Service or Container Apps meets your needs
  • You expect the platform to remove all operational work
  • You cannot afford the learning time and ongoing upkeep
Analogy

Using AKS for a tiny website is like buying a lorry fleet to carry one backpack. It works, but a bicycle, or a taxi, would be cheaper and simpler. Choose the vehicle that matches the load.

i
Portability is partial

Kubernetes itself is portable, but real clusters depend on cloud-specific load balancers, storage, identity, and networking. Moving between clouds is easier than with fully proprietary services, but is never effortless.

27Design Patterns That Work

Experience across many teams has produced reliable patterns for running workloads on Kubernetes.

Pattern

Stateless services

Keep application pods free of local state, so any copy can handle any request and can be replaced at will.

Pattern

Sidecar

Place a helper container beside the main one in the same pod, for tasks such as logging, proxying, or certificate handling.

Pattern

Init container

Run a one-time setup task before the main container starts, such as waiting for a database to be ready.

Pattern

Jobs and cron jobs

Run tasks that finish, either once or on a schedule, such as nightly reports.

Pattern

Namespace per team or environment

Separate teams and stages with namespaces, quotas, and policies for tidiness and safety.

Pattern

Dedicated node pools

Isolate special workloads such as graphics processing or memory-heavy jobs on their own pools.

Pattern

Circuit breakers and retries

Make services handle failing neighbours gracefully, so one slow service does not collapse the rest.

Pattern

Platform team and paved roads

A central team builds standard templates, pipelines, and guardrails so application teams move fast on safe ground.

Analogy

A sidecar is literally like the small passenger car attached to a motorcycle: it travels with the main vehicle, shares the journey, and carries extra equipment, without changing the motorcycle itself.

Namespaces and quotas

A resource quota limits the total resources a namespace may use, and a limit range sets defaults for pods that forget to declare them. Together they stop one team from consuming the whole cluster by accident.

28Anti-Patterns: Mistakes to Avoid

These habits feel convenient early on and cause pain later.

AP-1Avoid
No requests or limits

Pods without resource settings compete unpredictably, causing noisy neighbours and surprise evictions. Always declare requests, and set sensible limits.

AP-2Avoid
Using the “latest” image tag

The meaning of “latest” changes silently, so two nodes may run different code. Use specific, immutable versions, so every deployment is predictable and reversible.

AP-3Avoid
One big cluster-admin for everyone

Handing out full administrator rights is quick, but a single mistake or stolen account can destroy everything. Use narrow roles by namespace.

AP-4Avoid
Public API server with no restrictions

Exposing the management endpoint to the whole internet widens the attack surface. Prefer private clusters or limit access to trusted address ranges.

AP-5Avoid
Running everything on the system pool

Mixing application pods with essential cluster components lets a busy application starve the DNS and other vital services. Keep them apart.

AP-6Avoid
Manual changes to a live cluster

Editing things by hand produces drift and unrepeatable clusters. Make changes through code and pipelines, and let GitOps correct drift.

AP-7Avoid
Falling behind on upgrades

Skipping versions until support ends forces large, risky jumps and leaves known vulnerabilities open. Upgrade regularly in small steps.

AP-8Avoid
A single copy of important pods

One replica means any restart or node drain causes downtime. Run several copies, spread across nodes and zones, with a disruption budget.

AP-9Avoid
Secrets stored in plain manifests

Committing passwords to a repository exposes them to everyone with access, forever. Use a vault integration or sealed approaches.

AP-10Avoid
Adopting Kubernetes for its own sake

Choosing AKS because it is fashionable, for a simple application, creates cost and complexity without benefit. Start from the need, then choose the tool.

29Best Practices Checklist

Use this as a review list before a cluster goes to production.

AreaGood habit
FoundationUse a production tier, multiple zones, a planned network, and infrastructure as code.
Node poolsSeparate system and user pools, size from measurements, and use autoscaling with sensible limits.
WorkloadsSet requests and limits, add readiness and liveness checks, run several replicas, and add disruption budgets.
NetworkingPlan address ranges, use ingress for web traffic, apply network policies, and control outbound traffic.
IdentityEntra sign-in, narrow roles by namespace, workload identity for pods, and no shared admin accounts.
SecurityScan images, use private registries, restrict pods with policy, use Key Vault for secrets, enable threat detection.
OperationsCollect metrics and logs, alert on important signals, define maintenance windows, and upgrade regularly.
DeliveryAutomated pipelines or GitOps, immutable image versions, staged rollouts, and rehearsed rollbacks.
CostRight-size, autoscale, use spot where safe, tag and allocate costs, and review monthly.
RecoveryBack up data, practise restores, and be able to rebuild a cluster from code.

Common beginner mistakes

  • Treating pods like permanent servers, and storing important data in them.
  • Forgetting that deleting a namespace deletes everything inside it.
  • Creating a public load balancer for every service, instead of using one ingress.
  • Leaving test clusters running all weekend.
  • Ignoring pod restarts until users complain.
  • Assuming that “managed” means “nothing for me to do”.
Kubernetes rewards teams that automate, observe, and keep things small and replaceable. It punishes teams that treat it like a pile of hand-tended servers.

30Real-World Examples

Here are typical uses of AKS in different industries. The scenarios are illustrative.

An online retailer with seasonal peaks

A shop splits its website into services for browsing, cart, and payment. Autoscaling adds pods and nodes before a big sale, and removes them afterwards. The payment service lives in its own namespace with strict network policies, and a canary release tests changes on a small share of shoppers before everyone gets them.

A bank modernising old systems

A bank wraps older applications in containers one at a time, behind private clusters with controlled outbound traffic. Policies enforce non-root containers and approved registries only, and audit logs flow to a central security system for review.

A software company serving many customers

A company hosting a product for hundreds of customers separates customers by namespace, with quotas to prevent one from consuming everything. A platform team provides templates so each new customer environment is created automatically from code.

A data science team training models

A team uses a node pool with graphics processors, started only when training jobs are queued and removed afterwards. Spot nodes cut cost for work that can restart from checkpoints.

A media company streaming events

A broadcaster expects huge, sudden audiences during live events. It scales ahead of schedule, spreads pods across zones, and watches delay metrics closely, with a second region ready to take traffic if the first has trouble.

A start-up with a small team

A start-up with three developers begins with a simpler service, and moves to AKS only when it needs finer control over many services. They chose a managed, opinionated mode to reduce their operational load.

i
The common thread

In every story, the winning habits are the same: automation, small replaceable parts, careful limits, strong guardrails, and watching real numbers.

31Mini Labs to Practise

Practice makes ideas stick. Try these on a sandbox subscription, and delete everything when done.

A

Create a small cluster

Create a cluster with the smallest practical nodes in the free tier. Note the resource group Azure creates in your subscription for the nodes, and explore what is inside it.

B

Run a sample application

Deploy a simple web application with three copies, and expose it through a service. Find the pods and see which nodes run them.

C

Break something on purpose

Delete a pod and watch Kubernetes replace it. Then change the image name to a wrong one and observe the “image pull” error and how events explain it.

D

Try a rolling update and rollback

Update to a new image version, watch pods replaced gradually, then roll back and confirm the old version returns.

E

Scale it

Enable pod autoscaling, generate some load, and watch the number of pods change. If nodes fill up, watch the cluster autoscaler respond.

F

Add a network policy

Create two pods, confirm they can talk, then apply a policy that blocks one direction and confirm the block.

G

Look at monitoring

Enable monitoring, then open the views for node and pod performance. Find the restart counts and memory use of your application.

H

Clean up

Delete the cluster and its resource group, and verify nothing remains that could continue billing.

!
Mind the cost

Public load balancers, disks, and nodes cost money while they exist. Use small sizes, work in a throwaway resource group, and delete everything after each lab.

32Glossary in Plain Words

A quick reference to the terms used in this guide.

TermPlain meaning
AKSAzure’s managed Kubernetes service
ContainerA packaged application with everything it needs, running in isolation
ImageThe saved blueprint a container is started from
RegistryA library that stores container images
KubernetesAn open-source system that runs and manages containers across many machines
ClusterThe group of machines managed together
Control planeThe brain that stores desired state and makes decisions
NodeA worker machine
Node poolA group of identical nodes
PodThe smallest unit that runs; one or more closely linked containers
DeploymentAn instruction to keep a number of identical pods running, with updates
ServiceA stable address that spreads traffic to pods
IngressRules for routing outside web traffic to services
NamespaceA named partition of the cluster
Desired stateWhat you want the system to look like
ReconciliationConstantly closing the gap between desired and actual state
Request and limitThe reserved and maximum resources for a pod
Persistent volumeStorage that outlives a pod
Network policyA rule about which pods may talk to which
AutoscalerA tool that adds or removes pods or nodes automatically
Taint and tolerationA repelling mark on a node, and a pod’s permission to ignore it
Disruption budgetA limit on how many copies may be down during maintenance
Workload identityA way for pods to prove who they are without stored passwords
GitOpsKeeping desired state in Git and letting the cluster pull from it
Availability zoneA separate datacentre inside a region

33Frequently Asked Questions

Q1Is AKS the same as Kubernetes?
AKS is Azure’s managed service that runs Kubernetes for you. Kubernetes is the open-source system underneath. You use the same Kubernetes tools and concepts, while Azure operates the control plane.
Q2Do I have to learn Docker or containers first?
You need to understand containers and images, because Kubernetes runs them. You do not need to be an expert, but you should know how to build an image and run it locally.
Q3What does AKS cost?
You mainly pay for the worker node virtual machines, plus storage, networking, and monitoring. The control plane is free in the basic tier and has a small charge in paid tiers. Check current pricing on Microsoft’s site.
Q4Who manages the worker nodes?
The nodes run in your subscription. Azure provides tooling to create, upgrade, and scale them, but you decide sizes, counts, and update timing, and you are responsible for what runs on them.
Q5Can I log in to the control plane?
No. The control plane is hidden and managed by Azure. You interact only through the API server.
Q6What happens if a node fails?
Kubernetes notices, and reschedules the affected pods onto healthy nodes. With autoscaling or automatic repair, the failed node can also be replaced.
Q7How often should I upgrade?
Plan to move to a supported newer version regularly, and never let your version fall out of support. Test in a non-production cluster first, and use maintenance windows.
Q8Should I run databases in AKS?
It is possible, but demanding. Many teams use managed database services for critical data and keep AKS for stateless application code. Choose based on your skills and recovery requirements.
Q9How do pods get passwords safely?
Store secrets in Azure Key Vault and give pods access through a workload identity, rather than placing passwords in images or plain manifests.
Q10What is the difference between AKS and Azure Container Apps?
Container Apps is a simpler service built on Kubernetes that hides most of the cluster details. AKS gives you full Kubernetes access and control, with more power and more responsibility.
Q11Why is my pod stuck in Pending?
Usually there is no node with enough free resources, or a placement rule such as a taint or affinity cannot be met. Read the pod’s events, which name the reason.
Q12Do I need multiple clusters?
Often yes over time, for example separate clusters for production and non-production, or for regions and strict isolation. Start with the smallest number that meets your needs, because each cluster must be maintained.
Q13Is AKS secure by default?
Azure secures the control plane, but you must secure access, networking, images, and workloads. Use identity integration, network policies, private access, policy enforcement, and threat detection.
Q14Can I stop a cluster to save money?
Yes, AKS supports stopping a cluster, which pauses node charges while keeping its configuration. Some charges, such as storage and public addresses, continue.

34Summary and Key Takeaways

AKS gives you the power of Kubernetes without the burden of running its brain. Success depends on how you run what sits on top.

You have seen how containers solve the “works on my machine” problem, how Kubernetes orchestrates many containers using desired state and constant reconciliation, and how AKS splits the work between an Azure-managed control plane and worker nodes in your subscription. You learned about node pools, pods, deployments, services, and ingress, then explored networking, policies, storage, configuration, scaling, scheduling, and upgrades. You looked at identity, layered security, monitoring, reliability across zones and regions, cost control, delivery through pipelines and GitOps, and how to judge when AKS is the right tool at all.

Key Takeaways

  • AKS is managed Kubernetes: Azure runs the control plane, and you own the nodes, workloads, access, and costs.
  • Kubernetes works by desired state and reconciliation. Describe what you want, and let the system close the gap.
  • Always set resource requests and limits, add health checks, run multiple replicas, and use disruption budgets.
  • Plan networking and address ranges before creating production clusters, because they are hard to change later.
  • Use layered security: trusted images, Entra sign-in, narrow roles, network policies, Key Vault secrets, and threat detection.
  • Spread across availability zones for resilience, and add a second region only when the business case justifies it.
  • Automate with infrastructure as code, pipelines, and GitOps, upgrade regularly, and watch metrics, logs, and costs.
  • Choose AKS for genuine needs. Simpler services are often better for simple applications.