AKS Hour 6: Upgrades, Observability and Day-2 Operations

Day-2 operations: version lifecycle → safe upgrades (surge / blue-green / rollback) → auto-upgrade channels and maintenance windows → metrics, logs and audit → cost → stop/start and certificates
AKS 1.35 / 1.36 / 1.37Azure CLI 2.88+Node pool rollback GABlue-green node pool upgrade PreviewVerified against learn.microsoft.com · 2026-11
Overall learning goals
  • Understand the AKS version support policy: N-2 community support, N-3 platform support + 60-day grace period, LTS (Premium tier), and platform-initiated upgrades starting 2027-06-01. Be able to design an organization-wide upgrade strategy based on “environment tiers + cadence.”
  • Master a real node pool upgrade: surge node → cordon → drain (Eviction API, subject to PDBs) → soak → reimage → uncordon / become the buffer node for the next batch. Know how to tune --max-surge, --max-unavailable, --drain-timeout, --node-soak-duration and --undrainable-node-behavior.
  • Distinguish three kinds of operations: control plane upgrades, node pool upgrades and node image upgrades. Perform blue-green node pool migrations and az aks nodepool rollback (within 7 days), and understand that the control plane cannot be downgraded.
  • Configure the auto-upgrade channel for the cluster (patch / stable / rapid) and the node OS upgrade channel (NodeImage / SecurityPatch / Unmanaged / None), and use aksManagedAutoUpgradeSchedule and aksManagedNodeOSUpgradeSchedule to confine them to maintenance windows.
  • Enable Container Insights + Managed Prometheus. Configure diagnostic settings to send control plane logs (kube-apiserver, kube-audit-admin, etc.) to Log Analytics in resource-specific mode, and use KQL to answer “who changed what, and when.”
  • Enable the cost analysis add-on to allocate costs by namespace. Use day-to-day operations such as az aks stop/start and az aks rotate-certs correctly, and know their downtime impact and limits.

1-hour timetable

#TimingModuleCore contentAnimation / interactionLab (aks-lab-ops cluster)
0Before classSetup: multi-node-pool sample clusterCreate a Standard tier cluster on 1.35 (system + user pools), deploy myapp + PDB + availability proberEnvironment self-check listCluster, myapp and PDB ready
100–06Kubernetes versions and upgrade strategyN-2, patch lifecycle, N-3 platform support and 60-day grace period, platform-initiated upgrades, LTS, cross-version rules, version skew, deprecated APIsSupport window simulator: pick a version + date → support statusget-upgrades + deprecated API check
206–13Control plane and node pool upgradescontrol-plane-only, max surge / max unavailable, drain timeout, soak, undrainable nodes, forced upgrade, blue-green node pools, rollback limitsCore animation: surge upgrade (cordon → drain subject to PDB → reimage → uncordon)1.35 → 1.36: control plane first, then upgrade pool by pool and test availability
313–21Node images, auto-upgrade channels and maintenance windowsWeekly node image updates, --node-image-only, cluster auto-upgrade channels, node OS channels, three maintenance configuration types; platform-initiated upgrades are not bound by windows“One-week timeline” simulation: release → channel → window → executionConfigure stable + NodeImage and two windows
421–28Container Insights and Managed Prometheusama-logs / ama-metrics architecture, DCR, ContainerLogV2, cost presets, control plane metrics, GrafanaMetrics and log data flow animationEnable both and verify the agents and data
528–35Logs, diagnostic settings and control plane logsResource log categories, resource-specific mode, AKSAudit / AKSAuditAdmin / AKSControlPlane, Basic logs, upgrade eventsThe audit log journey of a single kubectl deleteDiagnostic settings + KQL audit queries
635–42Cost analysis add-on and optimizationOpenCost basics, prerequisites and limits, idle / system / service / unallocated, optimization techniquesNode cost allocation calculator based on requestsEnable cost analysis + apply labels
742–50Stop/start, certificate rotation and day-to-day maintenancestop/start limits, certificate types and validity periods, rotate-certs downtime, KSCR, daily checksStop/start and certificate rotation state machinestop/start + check certificate expiry
850–60Operations reviewUpgrade readiness review, runbooks, alert baseline, drills, upgrade failure troubleshootingOperations maturity scorecard + upgrade troubleshooting treeProduce a review report
—After classCheat sheet · Capstone labComplete an auditable, reversible upgrade on the “production candidate” clusterFinal quiz (12 questions)Capstone lab

Knowledge Coverage Matrix

Target skillM1M2M3M4M5M6M7M8Key commandsLab
Determine version support status and plan upgrades✓·✓····✓az aks get-versions, get-upgradesM1
Upgrade the control plane and node pools with low disruption·✓✓····✓az aks upgrade --control-plane-only, nodepool upgradeM2
Protect workloads with PDBs and drain parameters·✓····✓✓--drain-timeout, --undrainable-node-behaviorM2
Blue-green node pools and rollback·✓·····✓nodepool add, nodepool rollbackM2
Auto-upgrade channels and maintenance windows✓·✓····✓--auto-upgrade-channel, maintenanceconfiguration addM3
Metrics and container logs···✓✓··✓--enable-azure-monitor-metrics, enable-addons -a monitoringM4
Control plane logs and audit····✓··✓az monitor diagnostic-settings createM5
Cost allocation and optimization···✓✓✓✓·--enable-cost-analysisM6
Stop/start, certificates and day-to-day maintenance·····✓✓✓az aks stop/start, rotate-certsM7

What this hour does not cover (and where to learn it)

TopicWhy it is not in this hourWhere to learn it
General Kubernetes concepts such as PDBs, drain and rolling updatesThis hour only covers how AKS uses themKubernetes Hour 2; for AKS basics, see Kubernetes Hour 6
PromQL, recording rules, alerting rules, Grafana dashboard detailsBelongs to the Prometheus course topicsPrometheus & Grafana Hour 3 (Managed Prometheus)
Fleet Manager multi-cluster staged updates, GitOps-driven upgradesCovered in the previous hourAKS Hour 5
Cluster Autoscaler, NAP, VPA, Spot node poolsBelongs to the scaling topic (this hour only references it in the cost module)AKS Hour 4
In-depth troubleshooting of SNAT port exhaustion, subnet IP exhaustion and DNS failuresBelongs to the in-depth troubleshooting topicAKS Hour 7
Azure Backup for AKS, disaster recoveryBeyond 1 hourAzure Backup for AKS documentation

How to use this course material

10 pages per module
Principles · diagrams · animation · commands · lab · production cases · troubleshooting · quiz · voice · video. Read “Principles” and “Animation” first, then do the “Lab” hands-on. The surge upgrade animation in module 2 is the core of this hour.
Learning progress
A module counts toward progress once you score ≥ 70% on its quiz or click “Mark module complete.” Progress is saved in this browser's localStorage (it is cleared on refresh if local storage is disabled).
English voice
The “Voice” tab reads the narration script aloud using the browser's built-in Web Speech API (en-US). If no English voice pack is installed, the script can still be read or passed to another TTS tool.
Version notes Verified on 2026-11-15/16. The AKS versions with current GA community support are 1.35, 1.36 and 1.37 (1.37 reached GA in 2026-10; community support for 1.34 ends in 2026-11). 1.36 is the default version for new clusters (the portal and CLI default to N-1). 1.38 is expected to enter preview in 2026-11 and reach GA in 2027-02. Node pool version rollback (az aks nodepool rollback) is GA (requires Azure CLI 2.88.0+ and API 2026-04-01+); the blue-green node pool upgrade strategy is still in Preview. All commands are written against the current learn.microsoft.com documentation. The commands in this course material were not run on a real subscription; outputs are marked as examples. See the “Known limitations” on the sources page for details.

Module 0 · Setup: multi-node-pool sample cluster (complete before class)

To actually “upgrade,” we need a cluster that is deliberately one version behind: 1.35 → 1.36
Before class ≈ 15 min (cluster creation takes about 6–10 min)Standard tierIncurs charges
Prerequisites
  • Completed Hour 1 (familiar with az aks create, node pools and kubeconfig) and Hour 4 (node pools and scaling).
  • Azure CLI 2.88.0 or later (required for node pool rollback; check with az version), kubectl and kubelogin (az aks install-cli).
  • Azure roles: on rg-aks-lab, at least Contributor (to create the cluster and diagnostic settings); viewing cost analysis requires subscription-level Reader or Cost Management Reader; granting ACR access requires Owner or User Access Administrator.
  • Sample application: myapp from the Docker course (Flask + gunicorn + Redis, port 5000, /healthz, image myapp:1.0), already pushed to ACR acraks<suffix> in Hour 1.

Connection to the previous hour

In Hour 5 we managed aks-lab with IaC / GitOps. This hour does not run upgrade experiments on aks-lab (it may already be on the latest version and hosts resources for other hours). Instead, following course convention, we create a dedicated cluster, aks-lab-ops, pinned to 1.35 so we can rehearse the full 1.35 → 1.36 path. Variables follow the shared convention:

RG=rg-aks-lab; LOC=canadacentral; CLUSTER=aks-lab
OPS=aks-lab-ops                       # dedicated cluster for this hour
ACR=$(az acr list -g $RG --query "[0].name" -o tsv)   # reuse acraks<suffix> from Hour 1
echo "ACR=$ACR"
az account show --query "{sub:name, user:user.name}" -o table

Step 1: List regional versions and create the 1.35 cluster

az aks get-versions -l $LOC -o table

az group create -n $RG -l $LOC        # no effect if it already exists
az aks create -g $RG -n $OPS -l $LOC \
  --tier standard \
  --kubernetes-version 1.35 \
  --nodepool-name systempool --node-count 2 --node-vm-size Standard_D4s_v5 \
  --network-plugin azure --network-plugin-mode overlay \
  --enable-managed-identity --generate-ssh-keys \
  --auto-upgrade-channel none --node-os-upgrade-channel None \
  --attach-acr $ACR
KubernetesVersion    Upgrades
-------------------  ------------------------
1.37.1               None available
1.36.5               1.37.1
1.35.9               1.36.5
...
"currentKubernetesVersion": "1.35.9",
"provisioningState": "Succeeded",
  • --kubernetes-version 1.35: when only the minor version is given, AKS uses the latest GA patch of that minor (the example in this text is 1.35.9).
  • --tier standard: the cost analysis add-on in module 6 does not support the Free tier.
  • Turn off both auto-upgrade channels first (none / None); module 3 turns them on according to your policy. Otherwise the platform might upgrade the cluster before the experiments begin.

Step 2: Add the user node pool and set upgrade parameters

az aks nodepool add -g $RG --cluster-name $OPS -n apppool \
  --mode User --node-count 3 --node-vm-size Standard_D4s_v5 \
  --kubernetes-version 1.35 \
  --max-surge 1 --drain-timeout 15 --node-soak-duration 2

az aks nodepool list -g $RG --cluster-name $OPS \
  --query "[].{name:name,mode:mode,ver:currentOrchestratorVersion,count:count,surge:upgradeSettings.maxSurge,drain:upgradeSettings.drainTimeoutInMinutes}" -o table
Name        Mode    Ver     Count    Surge    Drain
----------  ------  ------  -------  -------  -------
systempool  System  1.35.9  2        10%      None
apppool     User    1.35.9  3        1        15

Note: what maxSurge shows for systempool depends on the API version used at creation time and on CLI defaults (the docs state both “default 1 node” and “usually 10%”). Use the actual values from az aks nodepool show; for production, explicitly set it to 33%.

Step 3: Deploy myapp + Redis + PDB + availability prober

az aks get-credentials -g $RG -n $OPS --overwrite-existing
kubectl create namespace myapp
cat <<EOF | kubectl apply -n myapp -f -
apiVersion: apps/v1
kind: Deployment
metadata: {name: redis}
spec:
  replicas: 1
  selector: {matchLabels: {app: redis}}
  template:
    metadata: {labels: {app: redis}}
    spec:
      nodeSelector: {kubernetes.azure.com/mode: user}
      containers:
      - name: redis
        image: redis:7-alpine
        ports: [{containerPort: 6379}]
---
apiVersion: v1
kind: Service
metadata: {name: redis}
spec: {selector: {app: redis}, ports: [{port: 6379}]}
---
apiVersion: apps/v1
kind: Deployment
metadata: {name: myapp}
spec:
  replicas: 4
  selector: {matchLabels: {app: myapp}}
  template:
    metadata: {labels: {app: myapp}}
    spec:
      nodeSelector: {kubernetes.azure.com/mode: user}
      topologySpreadConstraints:
      - maxSkew: 1
        topologyKey: kubernetes.io/hostname
        whenUnsatisfiable: ScheduleAnyway
        labelSelector: {matchLabels: {app: myapp}}
      containers:
      - name: myapp
        image: $ACR.azurecr.io/myapp:1.0
        env: [{name: REDIS_HOST, value: redis}]
        ports: [{containerPort: 5000}]
        readinessProbe: {httpGet: {path: /healthz, port: 5000}, periodSeconds: 5}
        resources: {requests: {cpu: 100m, memory: 128Mi}, limits: {memory: 256Mi}}
---
apiVersion: v1
kind: Service
metadata: {name: myapp}
spec: {selector: {app: myapp}, ports: [{port: 80, targetPort: 5000}]}
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata: {name: myapp-pdb}
spec:
  maxUnavailable: 1
  selector: {matchLabels: {app: myapp}}
EOF
kubectl get deploy,pdb,pod -n myapp -o wide
NAME                    READY   UP-TO-DATE   AVAILABLE
deployment.apps/myapp   4/4     4            4
deployment.apps/redis   1/1     1            1
NAME                                   MIN AVAILABLE   MAX UNAVAILABLE   ALLOWED DISRUPTIONS
poddisruptionbudget.policy/myapp-pdb   N/A             1                 1

The myapp image comes from the ACR where it was pushed in Hour 1. If myapp:1.0 is not in ACR, run az acr build -r $ACR -t myapp:1.0 . in the myapp directory of the Docker course. Redis has only 1 replica and no PDB; this is an intentional single point of failure, and module 2 will show its disruption during drain.

Step 4: Start the availability prober (keep it running throughout the course)

kubectl run prober -n myapp --image=curlimages/curl:8.11.1 --restart=Never \
  --overrides='{"spec":{"nodeSelector":{"kubernetes.azure.com/mode":"system"}}}' \
  --command -- sh -c 'while true; do c=$(curl -s -o /dev/null -m 2 -w "%{http_code}" http://myapp.myapp/healthz); echo "$(date +%T) $c"; sleep 1; done'
kubectl logs -n myapp prober -f | grep -v " 200$"     # show only the seconds that are not 200

The prober runs on the system pool so it does not get evicted during the apppool upgrade. It is a standalone pod; az aks stop in module 7 will delete it, so it will need to be recreated then.

Costs, permissions and security

Estimated cost (example figures; check the Azure pricing calculator) 5 × Standard_D4s_v5 at about US$1.0/hour + Standard tier control plane (billed per cluster-hour) + Log Analytics ingestion (modules 4–5, billed per GB) + extra surge nodes during upgrades. Completing this hour takes about 2–3 hours, ≈ US$3–5. When not in use, run az aks stop -g $RG -n $OPS (module 7); clean up at the end of the course.
Security risk Module 5 collects kube-audit-admin: audit logs contain usernames, source IPs and request objects, so grant access to the Log Analytics workspace on a least-privilege basis. Do not enable any “bypass protection” parameter other than --enable-force-upgrade on the lab cluster and then forget to revert it.
# Course cleanup (delete only this hour's cluster; keep aks-lab and ACR)
az aks delete -g $RG -n $OPS --yes --no-wait
# If the whole resource group is no longer needed:
# az group delete -n $RG --yes --no-wait

Self-check list

Module 1 · Kubernetes versions and upgrade strategy

00:00 – 06:00 · Upgrading is not “whether to do it” but “at what cadence and in what order”
6 minN-2 community support · LTS (Premium)Platform-initiated upgrades from 2027-06-01★★★★★
Learning objectives
  • Explain AKS's three support states: community support (N-2), platform support (N-3, including the 60-day grace period) and unsupported; and how LTS extends the support period by one year.
  • Know the patch lifecycle (at least two months), the regional rollout of releases (up to about 10 business days), and that new clusters default to N-1.
  • Master the upgrade rules: non-LTS versions cannot skip minor versions; LTS can upgrade across minors to a higher LTS; the control plane can lead node pools by at most 3 minor versions; node pools cannot be higher than the control plane.
  • Design an upgrade strategy for an organization: environment tiers (dev → staging → prod), cadence (monthly patches, quarterly minors), deprecated API checks and a rollback plan.
Prerequisite knowledge: semantic versioning, Kubernetes version skew policy. Importance: ★★★★★ (expired versions are the most common source of reactive AKS incidents)

What: the AKS version support policy

The Kubernetes community releases a minor version roughly every 4 months (e.g., 1.36 → 1.37), and each minor is maintained upstream for about a year. AKS divides this into several states:

StateScopeWhat you getWhat you cannot do
Community supportLatest GA version N and N-1, N-2 (currently 1.37 / 1.36 / 1.35)Patches, bug fixes and full technical support; you can create clusters and node pools—
Platform supportN-3 (currently 1.34; community support ends in 2026-11)Supports only Azure platform-related issues; upgrade yourself within the 60-day grace periodCannot create new clusters on this version; Kubernetes component issues are not supported
UnsupportedN-4 and olderNo security patches; subject to platform-initiated upgrades starting 2027-06-01Most operations are restricted
LTS (Long-Term Support)All supported versions can opt in; requires the Premium tier + --k8s-support-plan AKSLongTermSupportCommunity support 1 year + LTS 1 year ≈ 24 months; only the two most recent patches are supportedNot added automatically; some add-ons (such as the Microsoft-managed Calico) do not support LTS

Current calendar (verified 2026-11):

VersionAKS GACommunity support endsLTS endsPlanned platform-initiated upgrade month
1.342025-112026-112027-112027-06 (non-LTS)
1.352026-032027-032028-032027-06 (non-LTS)
1.362026-062027-062028-062027-09 (non-LTS)
1.372026-102027-102028-102028-01 (non-LTS)
1.382027-02 (planned)TBDTBDTBD

“Community support ends” refers to the last day of that month. “Planned platform-initiated upgrade month” is an estimate from official planning; AKS throttles by region, subscription and version, so the actual upgrade may happen later than that month.

Why: why upgrading must be routine work

  • Security: patch versions fix CVEs; once a version is unsupported, it receives no more patches.
  • Loss of control: platform-initiated upgrades ignore maintenance windows, do not stop for deprecated APIs, and can override PDBs that block drain. “Not upgrading” ends up as “being upgraded at a time you did not choose.”
  • Features and add-ons: new add-on versions are tied to Kubernetes versions (for example, LocalDNS is enabled by default in 1.37+, and Windows Server 2022 is no longer supported in 1.37+).

How: upgrade rules

  • Non-LTS cannot skip minors: 1.35 → 1.36 → 1.37, one step at a time.
  • LTS → higher LTS can skip: provided the target version is still offered in AKS and passes the version skew and validation checks.
  • Recovery path for unsupported versions: only a full cluster upgrade to the lowest supported version is possible (control-plane-only is not allowed).
  • Version skew: the control plane must be ≥ all node pools; since 1.28 the control plane can lead node pools by at most 3 minor versions (e.g., with the control plane on 1.35, node pools can be 1.32–1.35).
  • No downgrades: the control plane cannot be rolled back. Within 7 days after a node pool upgrade, you can use az aks nodepool rollback to return the pool to the previous version (module 2).
  • Patches: once a patch is offered, it has a lifecycle of at least two months. Removed patches have a 60-day upgrade period, but after removal they can no longer be used to create new clusters or node pools.

When: recommended upgrade cadence

TypeCadenceLever
Node image / OS security patchesWeeklyNode OS channel NodeImage or SecurityPatch + weekly maintenance window (module 3)
Kubernetes patchesMonthlypatch channel, or az aks upgrade in a pipeline
Kubernetes minorEvery quarter to every half year, staying near N-1stable channel + monthly maintenance window; or advance manually by environment ring. For multiple clusters, use Fleet (Hour 5)

Comparison: version policies of AKS / EKS / GKE (conceptual comparison)

DimensionAKSEKSGKE
Standard support windowN-2, about 12 monthsAbout 14 months of standard supportAbout 14 months
Extended supportLTS (Premium tier, +12 months)Extended support (extra charges)Extended channel
After expiryPlatform-initiated upgrade after the 60-day grace period (from 2027-06)Automatic upgrade at expiryAuto-upgrade
Auto-upgradeChannel + maintenance configurationManaged node groups must be triggered manually (Auto Mode is an exception)Release channel + maintenance window

The EKS and GKE columns are for conceptual comparison only; check each provider's official documentation for exact durations.

Common misconceptions ① “I set the auto-upgrade channel to none, so AKS will never upgrade my cluster.” — Wrong. After expiry + the 60-day grace period, platform-initiated upgrades happen regardless of the channel. ② “The default version in the portal is the latest.” — The default is N-1. ③ “LTS is free.” — LTS requires the Premium tier (for when Premium billing starts after community support ends, refer to the pricing page and release notes). ④ “You can upgrade node pools before the control plane.” — No; the control plane must be ≥ the node pools.

Timeline: the life of a minor version in AKS

Preview Community support (about 12 months)N → N-1 → N-2 · patches · can create new Platform support N-360-day grace period Platform-initiated upgradeIgnores windows / can override PDBs LTS (Premium tier, an additional 12 months)Only the two most recent patches · upgrade to the next LTS at expiry AKS GAEOL (end of month)+60 days Example: 1.35 — GA 2026-03 → community support ends 2027-03 → planned platform-initiated upgrade 2027-06; with LTS enabled, support runs to 2028-03
Figure 1-1: community support → platform support → platform-initiated upgrade; LTS is a parallel extended track

Upgrade paths and version skew

1.35.9 1.36.5 1.37.1 ✗ Non-LTS cannot jump directly from 1.35 → 1.37 LTS clusterCan jump to a higher LTS version(subject to skew and validation checks) Control plane 1.35Node pools allowed: 1.32 / 1.33 / 1.34 / 1.35(at most 3 minors behind; cannot be higher than the control plane) Unsupported recovery pathFull cluster upgrade only, to the lowest supported community version (or an LTS version)control-plane-only not available
Figure 1-2: step-by-step upgrades, LTS skips, and control plane / node pool version skew

Interactive simulator: what is this cluster's support status right now?

Choose the cluster version and whether LTS is enabled, then drag the “date.” The simulator calculates the status from the official calendar and gives the command you should run at that point. Months are counted as end-of-month, and the 60-day grace period is approximated as 2 months.

Cluster version:  
Date: 2026-11
Community supportLTSPlatform support / graceUnsupported / platform-initiated upgrade
Select a version, then drag the date to watch the status change.
$ az aks get-upgrades -g rg-aks-lab -n aks-lab-ops -o table

Core commands

CommandPurposeKey parameters / notes
az aks get-versions -l LOCAvailable versions and upgrade paths in a region-o table; LTS version markers are in the JSON under capabilities.supportPlan
az aks get-upgradesUpgrade targets for a given clusterControl plane targets; for node pools, use az aks nodepool get-upgrades
az aks show --query currentKubernetesVersionCurrent full version (including patch)kubernetesVersion may only be a minor alias
az aks update --tier premium --k8s-support-plan AKSLongTermSupportJoin LTSConfiguration change, no node recreation; also recommended: --auto-upgrade-channel patch
az aks update --tier free --k8s-support-plan KubernetesOfficialLeave LTSCan only leave while the version is still in community support
az aks get-upgrades -g $RG -n $OPS -o table
az aks nodepool get-upgrades -g $RG --cluster-name $OPS --nodepool-name apppool -o table
az aks show -g $RG -n $OPS --query "{cp:currentKubernetesVersion, tier:sku.tier, plan:supportPlan, auto:autoUpgradeProfile}" -o json
Name     ResourceGroup    MasterVersion    Upgrades
-------  ---------------  ---------------  --------
default  rg-aks-lab       1.35.9           1.36.5
{
  "auto": { "nodeOsUpgradeChannel": "None", "upgradeChannel": "none" },
  "cp": "1.35.9",
  "plan": "KubernetesOfficial",
  "tier": "Standard"
}

How to verify: Upgrades lists only one minor (1.36.x), which confirms “non-LTS cannot skip minors.” Common mistake: treating the output of az aks get-versions as the upgrade targets for this cluster. It is a regional view and does not consider your current version. Production use: in a pipeline, compare the output of get-upgrades against an internal allowed-versions list to prevent anyone from upgrading directly to a version that has just reached GA.

Check for deprecated and removed APIs

# 1) Portal: Cluster → Upgrades; when you select the target version, APIs that will be removed are highlighted
# 2) Command line: kube-no-trouble (kubent) scans the resources visible in the current kubeconfig
kubent --target-version 1.36.0
# 3) You can also check the apiserver deprecated API usage metric directly (requires permission to read /metrics)
kubectl get --raw /metrics | grep apiserver_requested_deprecated_apis
>>> Deprecated APIs removed in 1.36 <<<
KIND   NAMESPACE  NAME   API_VERSION   REPLACE_WITH (SINCE)
(none)   — if empty, the current manifests contain no APIs that will be removed

AKS's pre-upgrade validation also checks for deprecated APIs (“API breaking changes”). If it detects a recently used API that is about to be removed, it blocks the upgrade (for this behavior and how to override it, see --enable-force-upgrade in module 2). Platform-initiated upgrades skip this check.

Enable LTS for a production cluster (example; incurs Premium tier charges, not executed in this lab)

az aks update -g $RG -n $CLUSTER --tier premium --k8s-support-plan AKSLongTermSupport --auto-upgrade-channel patch

Lab 1: Assess the upgrade path of aks-lab-ops (read-only, about 5 min)

Goal: confirm the current version status, available upgrade targets and deprecated APIs, and write an upgrade plan. Environment: aks-lab-ops from module 0. Cost: no additional cost.

Check the regional version table
az aks get-versions -l $LOC -o table

Record the latest GA version (N), the default version, and how many minors behind N your version is.

Check the upgrade targets for the cluster and node pools
az aks get-upgrades -g $RG -n $OPS -o table
for p in systempool apppool; do az aks nodepool get-upgrades -g $RG --cluster-name $OPS --nodepool-name $p --query "{pool:'$p', latestImage:latestNodeImageVersion}" -o tsv; done
Check deprecated APIs
kubent --target-version 1.36.0 || echo "kubent not installed: check the Upgrades page in the portal instead"
Confirm the version skew
kubectl version -o yaml | grep gitVersion
kubectl get nodes -L agentpool -o custom-columns=NAME:.metadata.name,POOL:.metadata.labels.agentpool,KUBELET:.status.nodeInfo.kubeletVersion
NAME                                 POOL         KUBELET
aks-apppool-12345678-vmss000000      apppool      v1.35.9
aks-apppool-12345678-vmss000001      apppool      v1.35.9
aks-apppool-12345678-vmss000002      apppool      v1.35.9
aks-systempool-87654321-vmss000000   systempool   v1.35.9
aks-systempool-87654321-vmss000001   systempool   v1.35.9
Write the upgrade plan (template): target 1.36.5; order: control plane → systempool → apppool; parameters: apppool --max-surge 1 --drain-timeout 15 --node-soak-duration 2; acceptance: the prober shows no non-200 responses lasting more than 5 consecutive seconds; rollback: az aks nodepool rollback within 7 days; the control plane cannot be rolled back.

Verify: you can answer “why does get-upgrades only offer 1.36.x?” and “what happens if it is now 2027-07 and the cluster is still on 1.35?” Cleanup: none.

Case 1: a “shadow cluster” nobody has managed for a year

Problem: a team's PoC cluster is still on 1.32 and has left platform support. Approach: perform a full cluster upgrade to the lowest supported version via the recovery path (control-plane-only is not allowed). First use kubent to clean up removed APIs such as flowcontrol.apiserver.k8s.io/v1beta3, then upgrade step by step. Configuration: right after the upgrade, set the stable channel and a monthly maintenance window. Limitation: for a cluster that is clearly far behind, creating a new cluster and migrating (a blue-green cluster) is often safer.

Case 2: compliance requires “the version does not change for a year”

Problem: a regulated business needs re-certification for every minor upgrade. Approach: enroll production clusters in LTS (Premium tier), keep applying patches through the patch channel, and do one LTS → LTS skip upgrade per year. Limitations: LTS only supports the two most recent patches; the Microsoft-managed Calico does not support LTS (it returns LTSUnsupportedAddon).

Case 3: ring-based upgrades

Problem: 40 clusters across multiple teams. Approach: the dev ring uses rapid, staging uses stable, and prod uses Fleet Manager update runs that advance in stages, with waits and health checks between stages (Hour 5). Limitation: do not configure Fleet auto-upgrade and the cluster's own channel at the same time, to avoid two orchestrators competing for the same cluster.

Common errors and fixes

Node pool creation fails with a version-not-supported error: Version 1.33.x is not supported in this region (illustrative; the error code follows the actual output)

Cause: the version is no longer on the regional support list (versions in platform support cannot be used to create new clusters or node pools), or the patch has been removed.

az aks get-versions -l $LOC -o table

Fix: choose a version from the list. Specifying only the minor (e.g., 1.36) lets AKS pick the latest patch.

Skipping a minor during upgrade is rejected: Upgrading Kubernetes version 1.35.9 to 1.37.1 is not allowed. Available upgrades: 1.36.5 (illustrative)

Cause: non-LTS clusters cannot skip minor versions.

Fix: upgrade to 1.36.x first, then to 1.37.x. If you really need to skip, evaluate LTS or create a new cluster and migrate.

"code": "ValidationError", "message": "Control Plane upgrade is blocked due to recent usage of a Kubernetes API deprecated in the specified version..." "subcode": "UpgradeBlockedOnDeprecatedAPIUsage"

Cause: the pre-upgrade validation for a minor upgrade (target ≥ 1.26) found that, within the last 12 hours, a client made write operations using an API that the target version removes. Get/List/Watch are not counted; AKS records this once per hour.

kubent --target-version 1.36.0
kubectl get --raw /metrics | grep apiserver_requested_deprecated_apis
# Portal: Diagnose and solve problems → Create, Upgrade, Delete, and Scale → Kubernetes API deprecations

Fix (recommended): update the manifests and Helm charts, then retry once the last use is more than 12 hours old. Bypass: az aks upgrade ... --enable-force-upgrade --upgrade-override-until 2026-11-20T13:00:00Z (if omitted, the default is 3 days). Note that a forced upgrade also bypasses PDB constraints (module 2).

Upgrading a node pool first is rejected: node pool version cannot be greater than control plane version (illustrative)

Cause: an attempt to upgrade the node pool first.

Fix: run az aks upgrade --control-plane-only first, then upgrade the node pool.

Command-line tasks
1. Use one command to output the control plane version, pricing tier, support plan and both auto-upgrade channels.
az aks show -g $RG -n $OPS --query "{cp:currentKubernetesVersion,tier:sku.tier,plan:supportPlan,ch:autoUpgradeProfile.upgradeChannel,os:autoUpgradeProfile.nodeOsUpgradeChannel}" -o table
2. List each node's kubelet version and its node pool, and confirm that no version skew rule is violated.
kubectl get nodes -o custom-columns=NAME:.metadata.name,POOL:.metadata.labels.agentpool,VER:.status.nodeInfo.kubeletVersion
Scenario analysis
It is now 2027-04. A production cluster is on 1.35 (non-LTS) and its auto-upgrade channel is none. The team says, “Peak season runs until 2027-08, and we don't want to touch anything.” What would you recommend?

1.35's community support ends at the end of 2027-03, after which it moves to platform support with the 60-day grace period. The officially planned platform-initiated upgrade month is 2027-06. At that point upgrades ignore maintenance windows, skip the deprecated API check and can override PDBs, right in the middle of peak season. Recommendations: ① rehearse 1.35 → 1.36 in staging now, and upgrade at a suitable time before peak season; ② or enroll in LTS (Premium tier, 1.35 LTS until 2028-03) to postpone the upgrade until after peak season, but evaluate the Premium cost and add-on compatibility; ③ either way, set the stable/patch channel and a maintenance window to avoid drifting again.

Verified teaching videos

▶
Upgrading and Maintaining your Azure Kubernetes Service (AKS) Cluster — John Savill's Technical Training
English · systematic explanation of AKS upgrades, node images and maintenance. The recording predates this hour's verification date, so for version numbers and new features (rollback GA, platform-initiated upgrades), follow this hour.
▶
AKS upgrade options — Houssem Dellai
English · demonstration of upgrade options, usable as a supplement to modules 1–3

Official documentation

Video storyboard (about 80 seconds)

This course material cannot generate a video or MP3 directly. A storyboard and narration script are provided, and they can be passed to a video tool.

Shot 1 · 0–15s
Visual: horizontal timeline; the 1.35 block slides in from “Preview” into the green “Community support” zone.
Narration: Each Kubernetes minor version gets about one year of community support in AKS, and the three newest minor versions are supported at any time.
Shot 2 · 15–35s
Visual: the block moves into the yellow “Platform support” zone, and a 60-day countdown appears.
Narration: After community support ends, the version moves into platform support. You have a 60-day grace period to upgrade yourself.
Shot 3 · 35–55s
Visual: the countdown reaches zero, a red “Platform-initiated upgrade” stamp comes down, and the maintenance window and PDB icons are crossed out.
Narration: Starting June 2027, clusters that are still not upgraded when the grace period ends will be upgraded by the platform. This ignores maintenance windows, and it can override PDBs.
Shot 4 · 55–80s
Visual: a blue LTS track extends one year from the end of community support, next to a staircase: 1.35 → 1.36 → 1.37.
Narration: For a longer runway, you can enable LTS on the Premium tier. Otherwise, climb the staircase one step at a time; you cannot skip minor versions.
or score ≥ 70% on the quiz

Module 2 · Control plane and node pool upgrades: surge, blue-green and rollback

06:00 – 13:00 · Almost all upgrade risk lies in the node pools: every node has to be drained, rebuilt and then reconnected to traffic
7 minmax surge / max unavailable / soak GAnodepool rollback GABlue-green upgrade strategy Preview★★★★★
Learning objectives
  • Upgrade step by step in the order “control plane → system pool → user pools,” and understand the conflict between --control-plane-only and auto-upgrade channels.
  • Describe precisely each step of an AKS rolling upgrade: create surge node → cordon/drain old nodes (via the Eviction API, subject to PDBs) → soak → reimage → become the buffer node for the next batch → finally delete the extra surge nodes.
  • Choose values for maxSurge / maxUnavailable / drainTimeout / nodeSoakDuration / undrainableNodeBehavior, and calculate the required quota and subnet IPs.
  • Perform a blue-green node pool switch, use az aks nodepool rollback, and state the rollback limits (7 days, one step back only, control plane cannot be rolled back).
Prerequisite knowledge: PDBs, kubectl drain (K8s Hour 2), and the version rules from module 1. Importance: ★★★★★

What: three upgrade scopes

TypeScopeCommandWorkload impact
Control plane onlyAPI server, etcd, controller-manager, scheduler, etc. (hosted on the AKS side)az aks upgrade --control-plane-onlyNodes and Pods do not change; the data plane keeps running. During the upgrade the API may briefly reset connections, so controllers and clients must be able to retry
Full clusterControl plane + all node pools (pools are upgraded one after another)az aks upgrade --kubernetes-versionEvery node is drained and reimaged
Node pool onlyKubernetes version of the specified pool (also updates to the latest node image for that version)az aks nodepool upgrade --kubernetes-versionNodes in that pool are drained and reimaged

How: the real steps of a rolling (surge) upgrade

  1. Add surge nodes: add buffer nodes (new version, new image) to the VMSS according to maxSurge. This requires extra compute quota and subnet IPs.
  2. Cordon + drain: mark as many old nodes as there are buffer nodes as unschedulable (spec.unschedulable=true), then call the Eviction API (POST /api/v1/namespaces/{ns}/pods/{pod}/eviction) for each Pod on them, one by one. The API server checks the PDB: if allowed, the Pod is deleted (graceful termination); if not, it returns 429 Too Many Requests, and AKS retries until drainTimeout (default 30 minutes, range 5 minutes to 24 hours). DaemonSet Pods are not evicted.
  3. Soak (optional): after drain completes, wait nodeSoakDuration (default 0, maximum 30 minutes), giving you time to watch monitoring.
  4. Reimage: the old node is reimaged to the new version and rejoins the cluster, becoming the buffer node for the next batch. This is why the number of surge nodes stays constant.
  5. Repeat until all nodes are done.
  6. Remove surge nodes: delete the extra buffer nodes, restoring the original node count and zone balance.

You can watch these stages with kubectl get events --field-selector reason=Surge / Drain / Upgrade (event reason names come from the official documentation).

Key parameters

Parameter (CLI)DefaultNotes and recommendations
--max-surgeThe docs say “default 1 extra node” and elsewhere “usually 10%”; use nodepool show as the source of truthInteger or percentage (rounded up). Recommended for production: 33%. A larger value is faster but drains more nodes at once. For 1.35+ pools, if the full surge quota cannot be obtained, it automatically falls back to surge=1. The value is persisted and reused by later upgrades.
--max-unavailable0Adds no nodes; cordons and drains n existing nodes at the same time (in-place upgrade). Suitable when quota or capacity is insufficient. Cannot be set on the system pool; when 0, maxSurge must be > 0. The fallback logic “surge first, then fall back to in-place” when both are > 0 is currently in Preview.
--drain-timeout (minutes)305–1440. If Pods still remain after the timeout, the upgrade stops (any later PUT continues it); otherwise it is handled according to the undrainable node behavior.
--node-soak-duration (minutes)00–30; recommended 0–5.
--undrainable-node-behaviorScheduleSchedule: delete blocked nodes and replace them with surge nodes. Cordon (recommended): keep the node and label it kubernetes.azure.com/upgrade-status=Quarantined; the upgrade continues. Use together with --max-blocked-nodes.
--enable-force-upgrade --upgrade-override-untilDisableBypasses the deprecated API check and PDBs; set it in preference to undrainable node behavior. Last resort.

Quota and IP calculation: 5 pools × 4 nodes each, maxSurge 50% → you need 10 extra VMs of quota. With Azure CNI (non-Overlay), subnet IP demand ≈ (node count + maxSurge) × (1 + maxPods); Overlay only consumes subnet IPs for nodes. A single VMSS scale set is limited to 1000 instances; exceeding this is rejected before the upgrade starts.

Blue-green node pools (Blue/Green)

Manual blue-green (available in any version): create a green pool with the same spec (new version) → cordon the entire blue pool → drain node by node (also subject to PDBs) → observe → delete the blue pool. The advantage is that you can validate the new pool before draining, and if something goes wrong you can uncordon blue and switch back immediately; the cost is double node capacity. Managed blue-green (--upgrade-strategy bluegreen, requires aks-preview) lets AKS orchestrate the same process. It is currently Preview and not recommended for production.

Rollback boundaries

  • The control plane cannot be downgraded. That is why it is recommended to run control-plane-only first, verify API compatibility, and then upgrade the node pools.
  • Node pool rollback (az aks nodepool rollback, GA, CLI 2.88.0+): within 7 days after the upgrade completes, both the Kubernetes version and the node image return to the previously recorded version (N-1; you cannot roll back several steps in a row). You must first turn off the cluster auto-upgrade channel (to restore the image, you must also turn off the node OS channel). Rollback replaces nodes and is affected by PDBs. OS SKU changes cannot be rolled back, you cannot roll back to an unsupported version, and platform-initiated upgrades cannot be rolled back.
  • Node images cannot be manually downgraded to an arbitrary older version. Within 7 days, however, an image-only upgrade can be restored to the previous VHD via rollback.

When: choosing a method

ScenarioRecommended
General stateless pools with sufficient quotaRolling surge, maxSurge 33%, PDB allows ≥1 disruption
GPU / scarce SKU, no extra capacity availablemaxSurge 0 + maxUnavailable 1 (in-place)
Critical pool that must be switchable back instantlyManual blue-green node pools
Stateful workloads (LRS disks bound to a zone)Set surge to a multiple of 3 to keep zones balanced; or blue-green + zonal pools; PDB + sufficient drain timeout
Control plane version far behindNew cluster + traffic switchover (blue-green cluster), see Blue-green deployment of AKS clusters
Common misconceptions ① “Setting the PDB to minAvailable: 100% (or maxUnavailable: 0) is the safest.” — It makes drain fail forever and leaves the upgrade stuck halfway; AKS's pre-upgrade validation treats such PDBs as a configuration error. ② “The larger maxSurge is, the safer.” — A larger surge means more old nodes drained at the same time. ③ “If an upgrade fails, you can roll back the control plane.” — No. ④ “maxUnavailable can also be set on the system pool.” — It cannot be set.

Architecture diagram: components involved in a node pool upgrade

az aks nodepoolupgrade (ARM PUT)agentPools/write AKS resource providerUpgrade orchestrator: pre-checks (quota/IP/PDB/deprecated API/certificates/locks) cordon / evict VMSS scale-out / reimage kube-apiserverEviction subresource → check PDBAllowed: delete Pod · Denied: 429 PDBdisruptionsAllowed Node resource group MC_rg-aks-lab_aks-lab-ops_canadacentral · VMSS aks-apppool-xxxx-vmss vmss0000001.35 · Cordoneddraining… vmss0000011.35 · Ready vmss0000021.35 · Ready vmss0000031.36 · surge nodeReceives evicted Pods Events:reason=Surgereason=Drainreason=Upgrade
Figure 2-1: the RP orchestrates VMSS scale-out and reimage; drain is carried out through the API server's Eviction subresource, where PDBs take effect

Flowchart: upgrade order for a 3-node pool with maxSurge=1

① Add surge node S (1.36)Node count 3 → 4 ② cordon+drain N0Pod → S / N1 / N2 ③ soaknodeSoakDuration ④ reimage N0→1.36Becomes the buffer for the next batch ⑤ Repeat ②–④ for N1 and N2Drain one node at a time ⑥ Delete the extra surge nodeNode count 4 → 3, zone balance restored If the PDB keeps returning 429 during drain: · Reaching drainTimeout → the upgrade stops (the default Schedule behavior deletes and replaces the blocked node) · Cordon behavior → the node is labeled Quarantined, the upgrade continues, and it is handled manually afterward · Forced upgrade → bypasses PDBs (causes disruption)
Figure 2-2: surge node “rotation”: each old node that gets reimaged takes over as the buffer node

Core animation: node pool surge upgrade (cordon → drain subject to PDB → reimage → uncordon)

The apppool has 3 nodes on 1.35, with myapp at 4 replicas and redis at 1 replica. After choosing parameters, play it step by step: the terminal below each step shows the API that AKS is actually calling, or the events / kubectl output you would see.

maxSurge PDB Undrainable node behavior soak
Click “Next step” to start: the AKS resource provider receives the ARM PUT request from az aks nodepool upgrade.
$ az aks nodepool upgrade -g rg-aks-lab --cluster-name aks-lab-ops -n apppool --kubernetes-version 1.36.5
Ready (new version)Ready (old version)Cordoned / DrainingSurge / newReimaging / blocked

Core commands

CommandPurposeKey parameters
az aks upgrade --control-plane-onlyUpgrade the control plane only--kubernetes-version; not available when an auto-upgrade channel is enabled
az aks nodepool upgradeUpgrade a single node pool--kubernetes-version, --max-surge, --max-unavailable, --node-soak-duration, --no-wait
az aks nodepool updateChange the pool's persistent upgrade settings--max-surge, --max-unavailable, --drain-timeout, --node-soak-duration, --undrainable-node-behavior, --max-blocked-nodes
az aks nodepool get-rollback-versions / rollbackView / perform node pool rollbackWithin 7 days, to the previous recorded version
az aks nodepool operation-abortAbort an in-progress node pool operationThe pool enters the Canceled state; the operation can be started again afterward
kubectl get events --field-selector reason=DrainObserve upgrade stagesAlso reason=Surge, reason=Upgrade

1) Upgrade the control plane only

az aks upgrade -g $RG -n $OPS --kubernetes-version 1.36.5 --control-plane-only --yes
az aks show -g $RG -n $OPS --query "{cp:currentKubernetesVersion,state:provisioningState}" -o table
az aks nodepool list -g $RG --cluster-name $OPS --query "[].{name:name,ver:currentOrchestratorVersion}" -o table
Cp      State
------  ---------
1.36.5  Succeeded
Name        Ver
----------  ------
systempool  1.35.9
apppool     1.35.9

How to verify: the kubectl version Server Version shows v1.36.5, while node kubelet is still v1.35.9 (a skew of 1, which is allowed). Common error: with an auto-upgrade channel enabled, you get NotAllAgentPoolOrchestratorVersionSpecifiedAndUnchanged.

2) Set the pool's upgrade parameters, then upgrade

az aks nodepool update -g $RG --cluster-name $OPS -n apppool \
  --max-surge 1 --drain-timeout 15 --node-soak-duration 2 \
  --undrainable-node-behavior Cordon --max-blocked-nodes 1

az aks nodepool upgrade -g $RG --cluster-name $OPS -n apppool --kubernetes-version 1.36.5 --no-wait

# Observe (in a separate terminal)
kubectl get nodes -L agentpool,kubernetes.azure.com/upgrade-status -w
kubectl get events -A --field-selector reason=Drain -w
kubectl get events -A --field-selector reason=Surge
NAME                              STATUS                     ROLES   AGE   VERSION
aks-apppool-12345678-vmss000003   Ready                      <none>  70s   v1.36.5
aks-apppool-12345678-vmss000000   Ready,SchedulingDisabled   <none>  3h    v1.35.9
...
default  9m22s Normal  Surge  node/aks-apppool-12345678-vmss000003  Created a surge node [aks-apppool-12345678-vmss000003 apppool] for agentpool apppool
default  2m1s  Normal  Drain  node/aks-apppool-12345678-vmss000000  Draining node: [aks-apppool-12345678-vmss000000]
default  1m45s Normal  Upgrade node/aks-apppool-12345678-vmss000000 Soak duration 2m0s after draining node: aks-apppool-12345678-vmss000000

Production use: make --undrainable-node-behavior Cordon the default, so one bad PDB does not waste an entire maintenance window; pair it with an alert that monitors the upgrade-status=Quarantined label.

3) In-place upgrade (no added nodes, when quota is insufficient)

az aks nodepool upgrade -g $RG --cluster-name $OPS -n apppool \
  --kubernetes-version 1.36.5 --max-surge 0 --max-unavailable 1

4) Manual blue-green node pools

# green: new version, same spec
az aks nodepool add -g $RG --cluster-name $OPS -n appgreen --mode User \
  --node-count 3 --node-vm-size Standard_D4s_v5 --kubernetes-version 1.36.5
# freeze blue, then drain node by node (subject to PDBs)
kubectl cordon -l agentpool=apppool
for n in $(kubectl get nodes -l agentpool=apppool -o name); do
  kubectl drain $n --ignore-daemonsets --delete-emptydir-data --timeout=10m
done
# Switch-back plan: kubectl uncordon -l agentpool=apppool ; delete blue after confirming everything is correct
az aks nodepool delete -g $RG --cluster-name $OPS -n apppool --no-wait

Note: this hour's myapp uses nodeSelector: kubernetes.azure.com/mode=user, so the green pool (also in User mode) can receive Pods directly. If your workloads select nodes by agentpool=apppool, change the selector first.

5) Node pool rollback

az aks show -g $RG -n $OPS --query autoUpgradeProfile     # first confirm the channel is turned off
az aks nodepool get-rollback-versions -g $RG --cluster-name $OPS -n apppool
az aks nodepool rollback -g $RG --cluster-name $OPS -n apppool
az aks nodepool show -g $RG --cluster-name $OPS -n apppool \
  --query '{state:provisioningState,k8s:currentOrchestratorVersion,image:nodeImageVersion}'
{
  "image": "AKSUbuntu-2204gen2containerd-202610.20.0",
  "k8s": "1.35.9",
  "state": "Succeeded"
}

After the rollback, the control plane is still 1.36.5 and the node pool is 1.35.9 (a skew of 1, which is legal). The node image name in the example is only an illustrative format.

Lab 2: step-by-step 1.35 → 1.36 upgrade and disruption measurement (about 30–45 min, mostly waiting)

Goal: upgrade the control plane first, then systempool and apppool; measure disruption with the prober; and observe the impact of Redis's single replica. Cost: one extra surge VM during the upgrade. Permissions: Contributor (or AKS Contributor). Risk: Redis has no replica, so draining its node causes a brief outage. This is the phenomenon this lab is meant to observe.

Record a baseline
kubectl get pod -n myapp -o wide
kubectl get pdb -n myapp
kubectl logs -n myapp prober --tail=3
Upgrade the control plane
time az aks upgrade -g $RG -n $OPS --kubernetes-version 1.36.5 --control-plane-only --yes
kubectl version | grep Server

Expected: Server Version v1.36.5; the prober shows no non-200 responses (even if API connections reset, the data plane is unaffected).

Upgrade systempool (maxUnavailable cannot be used on the system pool)
az aks nodepool update -g $RG --cluster-name $OPS -n systempool --max-surge 33%
az aks nodepool upgrade -g $RG --cluster-name $OPS -n systempool --kubernetes-version 1.36.5 --yes

Note: the prober is a standalone Pod not managed by any controller, so it will not be recreated when its node is drained (AKS's exact handling of standalone Pods follows actual behavior). If kubectl get pod -n myapp prober shows nothing after the upgrade, recreate it with the module 0 command. In production, run the prober as a Deployment.

Upgrade apppool and observe
az aks nodepool update -g $RG --cluster-name $OPS -n apppool --max-surge 1 --drain-timeout 15 --node-soak-duration 2 --undrainable-node-behavior Cordon
az aks nodepool upgrade -g $RG --cluster-name $OPS -n apppool --kubernetes-version 1.36.5 --no-wait
watch -n5 'kubectl get nodes -L agentpool; kubectl get pod -n myapp -o wide; kubectl get pdb -n myapp'
myapp-pdb   N/A   1   0      ← ALLOWED DISRUPTIONS briefly 0 during drain (1 Pod is being rebuilt)
prober:  10:21:07 000  10:21:08 000 ... 10:21:19 200   ← about 10 seconds of 5xx/timeouts while Redis is evicted
Acceptance
az aks nodepool list -g $RG --cluster-name $OPS --query "[].{n:name,v:currentOrchestratorVersion,img:nodeImageVersion}" -o table
kubectl get nodes -o custom-columns=NAME:.metadata.name,VER:.status.nodeInfo.kubeletVersion

All nodes on v1.36.5; apppool still has 3 nodes (surge node deleted).

(Optional) Practice rollback: az aks nodepool rollback -g $RG --cluster-name $OPS -n apppool, confirm it returns to 1.35.9, then upgrade to 1.36.5 again.

Cleanup: none (the cluster continues to be used in later modules). Think about it: how would you eliminate the Redis disruption? Run Redis with primary/replica and Sentinel, or switch to Azure Managed Redis, and configure a PDB for it.

Case 1: a PDB stalled an upgrade for 30 minutes

Problem: a service has 2 replicas and PDB minAvailable: 2. The overnight auto-upgrade failed after the first node's drain timed out, leaving the cluster in provisioningState=Failed. Approach: change to maxUnavailable: 1 and scale to 3 replicas; set the pool to --undrainable-node-behavior Cordon --max-blocked-nodes 1; alert on the Quarantined label. Limitation: after Cordon, quarantined nodes must be handled manually (delete the PDB or label, or delete-machines, then run az aks update to reconcile the state).

Case 2: a GPU pool cannot get surge capacity

Problem: AllocationFailed / SKUNotAvailable; surge nodes cannot be created. Approach: upgrade the GPU pool in place with --max-surge 0 --max-unavailable 1; pause training jobs or checkpoint them before the maintenance window. Limitation: pool capacity drops during an in-place upgrade, and Pending Pods wait.

Case 3: blue-green switchover for a payments core pool

Problem: the team must be able to switch back within 1 minute if something goes wrong. Approach: for each minor upgrade, create a green pool; canary-style, first drain one blue node and observe it for 30 minutes, then migrate everything; keep the blue pool for 24 hours before deleting it. Limitations: the cost and quota of double capacity; changing the node pool name affects selectors based on the agentpool label and Azure Policy.

Common errors and fixes

Code: UpgradeFailed Message: Drain node ... failed when evicting pod ... Cannot evict pod as it would violate the pod's disruption budget.

Cause: the PDB allows no disruption (replicas ≤ minAvailable, or Pods that are not Ready leave currentHealthy too low), so drain keeps receiving 429 until drainTimeout.

kubectl get pdb -A -o custom-columns=NS:.metadata.namespace,NAME:.metadata.name,ALLOWED:.status.disruptionsAllowed,HEALTHY:.status.currentHealthy,DESIRED:.status.desiredHealthy
kubectl get nodes -l kubernetes.azure.com/upgrade-status=Quarantined

Fix: correct the PDB (maxUnavailable: 1) or add replicas, then rerun the upgrade (any PUT will continue it). Prevention: --undrainable-node-behavior Cordon.

NotAllAgentPoolOrchestratorVersionSpecifiedAndUnchanged: Using managed cluster api, all Agent pools' OrchestratorVersion must be all specified or all unspecified...

Cause: --control-plane-only was run while the cluster had an auto-upgrade channel enabled.

az aks show -g $RG -n $OPS --query autoUpgradeProfile.upgradeChannel

Fix: temporarily set the channel to none and upgrade step by step, or accept a full cluster upgrade.

SubnetIsFull / AllocationFailed / QuotaExceeded during upgrade surge

Cause: surge nodes need extra IP and vCPU quota.

az vm list-usage -l $LOC -o table | grep -i "Standard DSv5"
az network vnet subnet show -g $RG --vnet-name vnet-aks-lab -n snet-nodes --query "{prefix:addressPrefix, used:length(ipConfigurations)}"

Fix: lower maxSurge or switch to maxUnavailable; request more quota; enlarge the subnet or switch to Azure CNI Overlay (the node subnet only consumes node IPs). See Hour 7.

Rollback: get-rollback-versions returns empty / AKS rejects the previous Kubernetes version

Cause: more than 7 days have passed, there is no upgrade record, the previous version is no longer supported, or the OS SKU has been changed.

Fix: if rollback is not possible, the only option is to roll forward: fix the application, replace the node pool (blue-green), or create a new pool with --kubernetes-version set to a still-supported older version (it must be ≤ the control plane and within the skew range).

Cluster provisioningState: Failed; every later operation fails

Cause: the upgrade failed midway (drain timeout, quota, etc.), leaving the cluster in a failed state.

az aks show -g $RG -n $OPS --query "{state:provisioningState,power:powerState.code}"
az monitor activity-log list -g $RG --offset 6h --query "[?contains(operationName.value,'managedClusters')].{op:operationName.value,status:status.value,msg:properties.statusMessage}" -o table

Fix: after fixing the root cause, run az aks update -g $RG -n $OPS once with no extra parameters (to reconcile the state), or start the upgrade again.

Command-line tasks
1. Configure apppool with: surge 33%, drain timeout 20 minutes, soak 3 minutes, quarantine for undrainable nodes, and a maximum of 2 blocked nodes.
az aks nodepool update -g $RG --cluster-name $OPS -n apppool --max-surge 33% --drain-timeout 20 --node-soak-duration 3 --undrainable-node-behavior Cordon --max-blocked-nodes 2
2. List all nodes quarantined by an upgrade (Quarantined), and remove that label after fixing the PDB.
kubectl get nodes -l kubernetes.azure.com/upgrade-status=Quarantined
kubectl label nodes NODE kubernetes.azure.com/upgrade-status-
Scenario analysis
A 12-node user pool uses Azure CNI (non-Overlay), maxPods=30, and the subnet has 300 IPs left. The team wants to set maxSurge to 50% to shorten the window. Is this feasible?

maxSurge 50% → 6 surge nodes. Each node uses 1 + maxPods = 31 IPs, so 6 × 31 = 186 IPs, and the remaining 300 is enough. You must also confirm the vCPU quota for the 6 extra VMs. Another risk is draining 6 nodes at once, so your PDBs and remaining capacity must be able to absorb that. For production, 33% (4 nodes) is recommended. If the subnet is tight, moving to Overlay networking fixes the root cause.

Verified teaching videos

▶
AKS cluster upgrades and managed K8s — ITOpsTalk
English voice · Microsoft ITOpsTalk channel, explaining the managed Kubernetes upgrade process
▶
Upgrading and Maintaining your Azure Kubernetes Service (AKS) Cluster — John Savill's Technical Training
English voice · covers surge upgrade mechanics; for newer features such as node pool rollback GA, follow this lesson

Official documentation

Video storyboard (about 100 seconds)

This lesson cannot directly generate a video or MP3, so a storyboard and narration script are provided instead.

Shot 1 · 0–20s
Visual: three grey nodes. A fourth blue “surge” node pops out of the VMSS.
Narration: When the upgrade starts, AKS first creates one buffer node on the new version based on max surge, so capacity does not drop.
Shot 2 · 20–50s
Visual: the first old node turns yellow and is cordoned. Pods fly toward the API server one by one. At the PDB shield, a green light lets them through, and a red light returns 429.
Narration: Next, the old node is marked unschedulable, and pods are evicted one at a time through the eviction API. Every eviction is checked against the PDB. If it is not allowed, the API returns 429, and AKS keeps retrying until the timeout.
Shot 3 · 50–75s
Visual: the empty node flashes red with “reimage,” turns green, and shows 1.36. Then it becomes the buffer for the next node.
Narration: Once the node is empty, it goes through an optional soak period, is reimaged to the new version, and then becomes the buffer node for the next batch.
Shot 4 · 75–100s
Visual: everything turns green, and the extra nodes fade out. A “7-day rollback” clock and a “control plane cannot be downgraded” badge appear in the bottom-right corner.
Narration: After everything is done, the extra buffer nodes are deleted. A node pool can be rolled back one step within seven days, but the control plane cannot be downgraded.
or score ≥ 70% on the quiz

Module 3 · Node image upgrades, auto-upgrade channels and maintenance windows

13:00 – 21:00 · Two channels decide “what to upgrade.” Three maintenance configurations decide “when to upgrade.”
8 minauto-upgrade · node OS channel GAShared maintenance window Preview★★★★★
Learning objectives
  • Distinguish Kubernetes version upgrades from node image upgrades. Linux node images are released weekly, and Windows images monthly. A node image upgrade does not change the Kubernetes version.
  • Explain the meaning of the cluster auto-upgrade channels none / patch / stable / rapid / node-image (legacy), and the differences among the node OS channels None / Unmanaged / SecurityPatch / NodeImage.
  • Use az aks maintenanceconfiguration add to create default, aksManagedAutoUpgradeSchedule, and aksManagedNodeOSUpgradeSchedule. Know the rules for a duration of at least 4 hours, a lead time of 15 minutes, notAllowedDates, and so on.
  • Know the boundaries of a window. Maintenance is best effort. Emergency fixes and platform-initiated upgrades can ignore the window. An operation that starts inside the window can finish after it ends.
Prerequisite: surge upgrades from Module 2 (node image upgrades follow the same surge and drain settings). Importance: ★★★★★

What: node images (VHD)

AKS nodes boot from VHDs built by AKS (for example AKSUbuntu-2404gen2containerd-YYYYMM.DD.x, Azure Linux 3, or Windows Server 2025). The image includes OS patches, containerd, kubelet, and so on. New images are released weekly for Linux and monthly for Windows. With safe deployment practices, all regions are covered in about two weeks. Track progress in the AKS release tracker. Running nodes do not switch images on their own. You must use a node image upgrade (reimage) or a node OS channel.

  • Manual: az aks nodepool upgrade --node-image-only (one pool) or az aks upgrade --node-image-only (all pools).
  • Any Kubernetes upgrade also moves node images to the latest version.
  • Node images cannot be downgraded manually. Within 7 days, a node pool rollback can restore the previous VHD.
  • Clusters with NAP enabled get their images updated by NAP's drift logic (see hour 4).
  • Watch for retirement: Azure Linux 2.0 images are removed starting 2026-10-31. Node pools still using them cannot scale out, so migrate them to AzureLinux3.

Cluster auto-upgrade channels (Kubernetes version)

ChannelBehavior (examples use 1.35.7; available versions are 1.35.9 / 1.36.4 / 1.36.5 / 1.37.1)Best for
noneNo automatic upgrades (default for Standard clusters)Fully controlled by pipelines or people
patchUpgrades to the latest patch of the same minor version → 1.35.9You want patches quickly while controlling minor upgrades yourself; recommended for LTS clusters
stableUpgrades to the latest patch of N-1 → 1.36.5Most production clusters; AKS Automatic always uses this
rapidUpgrades to the latest patch of the newest minor version. If you are on N-2, upgrade to the latest patch of N-1 first → 1.36.5 → 1.37.1dev / early validation environments
node-image (legacy)Only auto-upgrades node images; planned for deprecationSwitch to the node OS channel NodeImage

Key points: auto-upgrade only moves to GA versions. Upgrade the control plane first, then upgrade node pools one at a time. Channel changes can take up to 24 hours to take effect. The cluster must be within its support window; after it expires, auto-upgrade no longer applies and the platform-initiated upgrade takes over. Once enabled, control-plane-only upgrades are no longer possible.

Node OS auto-upgrade channels (these do not change the Kubernetes version)

ChannelWho is responsibleCadenceDetails
NoneYou—No security updates are applied automatically
UnmanagedBuilt-in OS mechanismUbuntu/Azure Linux, around 06:00 UTC dailyunattended-upgrades / dnf-automatic; new machines start unpatched; needs a tool such as kured to handle reboots; on Windows, equivalent to None
SecurityPatchAKS (tested, safe deployment)Usually faster than weeklySecurity patches only. Reimages only when necessary; otherwise patches online without draining. VHDs are stored in the node resource group, which adds cost. Windows is not supported. Requires access to snapshot.ubuntu.com. Conflicts with deny policies that require CMK (it temporarily creates a VMSS with a copy- prefix).
NodeImageAKSWeeklyReplaces the VHD (including security and bug fixes), and follows the maintenance window and surge settings. No extra VHD cost. Default for new Standard clusters since API 2023-06-01. AKS Automatic always uses this.

When you choose NodeImage, SecurityPatch, or the cluster channel node-image, unattended upgrades on Linux are disabled by default. When the cluster channel is node-image, the node OS channel is locked to NodeImage and cannot be changed. Switching from another channel to Unmanaged (or from Unmanaged to None) triggers a reimage.

Maintenance configurations (Planned Maintenance)

NameWhat it controlsSupported cadence
defaultControl plane components and system add-ons (CoreDNS, metrics-server, and so on) in the AKS weekly releaseWeekly only
aksManagedAutoUpgradeScheduleRun time for the cluster auto-upgrade channelDaily / Weekly / AbsoluteMonthly / RelativeMonthly
aksManagedNodeOSUpgradeScheduleRun time for the node OS channelDaily / Weekly / AbsoluteMonthly / RelativeMonthly
  • Window duration at least 4 hours. After you create or change a configuration, leave at least 15 minutes before the window starts.
  • Properties: startDate, startTime, utcOffset (default +00:00), durationHours, schedule, notAllowedDates (config file method only).
  • Best effort: operations that start inside the window can finish after it ends, but no new upgrade operation starts after the window closes. Within the same window, if a newer image appears, a node may be upgraded twice.
  • Urgent, critical reactive maintenance can break the window (even notAllowedDates). Platform-initiated upgrades do not follow the window.
  • The cluster must be running when the window starts. A stopped cluster cannot perform any operations.
  • Do not share one window across all clusters in a subscription (this causes ARM throttling). Shared maintenance window resources (az aks maintenancewindow) are currently in Preview.
  • Maintenance windows have nothing to do with Azure platform maintenance of the underlying VMSS hosts.

When: recommended combinations

EnvironmentCluster channelNode OS channelsWindow
devrapidNodeImageWeekday daytime, weekly
stagingstableNodeImage1 week earlier than prod
prodstable (or patch, with pipeline-controlled minor upgrades)NodeImage (use SecurityPatch for faster security fixes)Cluster: first Sunday of each month, 4–6 hours. Node OS: every Sunday.
LTS prodpatchNodeImage / SecurityPatchSame as above
Common misconceptions ① “Creating a maintenance window turns on auto-upgrade.” No. The window only decides the timing. ② “If the cluster channel is stable, node images update every week.” No. The cluster channel only controls the Kubernetes version. Node images depend on the node OS channel, or they update with each version upgrade. ③ “The maintenance window guarantees upgrades happen only inside it.” No. It is best effort, and platform-initiated upgrades and emergency maintenance are exceptions. ④ “SecurityPatch reimages every time.” No. It reimages only when needed, for example for some kernel packages.

Architecture diagram: two channels + three maintenance configurations

AKS weekly releaseControl plane components / add-onsNew K8s patches / new VHDs Cluster auto-upgrade channelnone / patch / stable / rapid Node OS auto-upgrade channelNone / Unmanaged / SecurityPatch / NodeImage (no channel needed)Control plane components / system add-ons aksManagedAutoUpgradeScheduleFor example: first Sunday of each month at 02:00, 4h aksManagedNodeOSUpgradeScheduleFor example: every Sunday at 02:00, 4h defaultWeekly only Exceptions: platform-initiated upgrades (expiry + 60 days) and urgent security fixes can ignore the window.
Figure 3-1: “What to upgrade” is decided by the channel. “When to upgrade” is decided by the matching maintenance configuration.

Node OS channel comparison: NodeImage vs SecurityPatch

NodeImage (weekly) New VHD: security fixes + bug fixesEvery time: surge + drain + reimageNo extra VHD cost; Windows supportedBuild → test → release takes about 2 weeks (critical CVEs can speed this up)Label: kubernetes.azure.com/node-image-version SecurityPatch (faster) Security patches only (AKS tested, from the Ubuntu snapshot)Mostly patched online, no drainReimage when necessary (follows window and surge settings)Extra VHD storage cost; Windows not supportedThe image tag suffix shows the patch date, for example …-2024.12.01
Figure 3-2: trade-offs between the two managed node OS channels

Simulator: over one month, what do the channels and window do to the cluster?

Pick two channels and a window, then press play. Each “day” may include an AKS release event (new VHD, new patch, new minor version). The simulator checks whether the channel cares about the event and whether that day is inside the window, then prints the matching real operation in the terminal.

Cluster channel Node OS channel Cluster window Node OS window
Cluster: 1.35.7, node image 202610.06.0.
$ az aks show -g rg-aks-lab -n aks-lab-ops --query autoUpgradeProfile

Core commands

CommandPurposeKey parameters
az aks nodepool get-upgradesShow the latest node image available to the poolOutput field latestNodeImageVersion
az aks nodepool upgrade --node-image-onlyUpgrade node images for a single poolUses the pool's surge, drain, and soak settings
az aks upgrade --node-image-onlyUpgrade node images for all pools--yes
az aks update --auto-upgrade-channelSet the cluster channelnone|patch|stable|rapid|node-image
az aks update --node-os-upgrade-channelSet the node OS channelNone|Unmanaged|SecurityPatch|NodeImage (SecurityPatch requires CLI 2.61+)
az aks maintenanceconfiguration add|update|list|show|deleteMaintenance window--name, --schedule-type, --day-of-week, --interval-weeks, --duration, --utc-offset, --start-time, --config-file

1) Manual node image upgrade

az aks nodepool get-upgrades -g $RG --cluster-name $OPS --nodepool-name apppool --query latestNodeImageVersion -o tsv
az aks nodepool show -g $RG --cluster-name $OPS -n apppool --query nodeImageVersion -o tsv
az aks nodepool upgrade -g $RG --cluster-name $OPS -n apppool --node-image-only --no-wait
kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.metadata.labels.kubernetes\.azure\.com\/node-image-version}{"\n"}{end}'
AKSUbuntu-2204gen2containerd-202611.03.0
AKSUbuntu-2204gen2containerd-202610.20.0
aks-apppool-12345678-vmss000000   AKSUbuntu-2204gen2containerd-202611.03.0
aks-systempool-87654321-vmss000000 AKSUbuntu-2204gen2containerd-202610.20.0

2) Set both channels

az aks update -g $RG -n $OPS --auto-upgrade-channel stable --node-os-upgrade-channel NodeImage
az aks show -g $RG -n $OPS --query autoUpgradeProfile
{
  "nodeOsUpgradeChannel": "NodeImage",
  "upgradeChannel": "stable"
}

3) Create maintenance configurations (CLI parameters)

# Node OS: every Sunday 02:00–06:00 (UTC-05:00, Toronto winter time)
az aks maintenanceconfiguration add -g $RG --cluster-name $OPS \
  --name aksManagedNodeOSUpgradeSchedule \
  --schedule-type Weekly --day-of-week Sunday --interval-weeks 1 \
  --duration 4 --utc-offset -05:00 --start-time 02:00

# Cluster version: first Sunday of each month, 02:00–08:00
az aks maintenanceconfiguration add -g $RG --cluster-name $OPS \
  --name aksManagedAutoUpgradeSchedule \
  --schedule-type RelativeMonthly --day-of-week Sunday --week-index First --interval-months 1 \
  --duration 6 --utc-offset -05:00 --start-time 02:00

az aks maintenanceconfiguration list -g $RG --cluster-name $OPS -o table

--week-index (First/Second/Third/Fourth/Last) and --interval-months are used for RelativeMonthly. AbsoluteMonthly uses --day-of-month. Daily uses --interval-days (aksManaged* configurations only). --start-date sets the effective date. Parameters were checked against the CLI reference (az aks maintenanceconfiguration, 2026-09).

4) Config file method (supports notAllowedDates, for example a year-end freeze)

{
  "properties": {
    "maintenanceWindow": {
      "schedule": { "relativeMonthly": { "intervalMonths": 1, "dayOfWeek": "Sunday", "weekIndex": "First" } },
      "durationHours": 6,
      "utcOffset": "-05:00",
      "startTime": "02:00",
      "notAllowedDates": [ { "start": "2026-12-20", "end": "2027-01-04" } ]
    }
  }
}
az aks maintenanceconfiguration update -g $RG --cluster-name $OPS \
  --name aksManagedAutoUpgradeSchedule --config-file ./aksManagedAutoUpgradeSchedule.json

Common mistakes: a window shorter than 4 hours stops auto-upgrade from finishing. Setting the window to “5 minutes from now” means it will not take effect this time (it needs at least 15 minutes of lead time). Putting all clusters in the same window causes ARM throttling. Production use: manage these through Terraform (maintenanceConfigurations in azapi_resource) or Bicep. See hour 5.

Lab 3: Configure “stable + NodeImage + two windows” for aks-lab-ops (about 10 minutes)

Goal: turn on the auto-upgrade you disabled in Module 0, using production policy, and verify it. Cost: no extra cost (later auto-upgrades will incur surge node costs). Risk: if your window falls within the next few hours, the cluster may actually start upgrading. During the lab, set the window to next week.

Do a node image upgrade by hand first (confirm that the surge and drain settings also apply)
az aks nodepool upgrade -g $RG --cluster-name $OPS -n apppool --node-image-only --yes
kubectl get events -A --field-selector reason=Drain | tail -3
Set the channels
az aks update -g $RG -n $OPS --auto-upgrade-channel stable --node-os-upgrade-channel NodeImage
Create two windows (use the two maintenanceconfiguration add commands on the “Commands” tab above)
Verify
az aks show -g $RG -n $OPS --query autoUpgradeProfile -o json
az aks maintenanceconfiguration show -g $RG --cluster-name $OPS --name aksManagedAutoUpgradeSchedule --query maintenanceWindow
{
  "durationHours": 6,
  "schedule": { "relativeMonthly": { "dayOfWeek": "Sunday", "intervalMonths": 1, "weekIndex": "First" }, "weekly": null, ... },
  "startTime": "02:00",
  "utcOffset": "-05:00"
}
Prove that control-plane-only upgrade is disabled
az aks upgrade -g $RG -n $OPS --kubernetes-version 1.37.1 --control-plane-only --yes

Expected error: NotAllAgentPoolOrchestratorVersionSpecifiedAndUnchanged (or a version-not-available error if 1.37 is not yet available for this cluster).

Cleanup/rollback: if you do not want auto-upgrades during the course, run az aks update -g $RG -n $OPS --auto-upgrade-channel none --node-os-upgrade-channel None. You can keep the window configurations.

Case 1: Monday morning, and you find all nodes were rebuilt

Problem: no node OS window was configured, so the NodeImage channel reimaged nodes during weekday daytime. Fix: create aksManagedNodeOSUpgradeSchedule (every Sunday, 4 hours). Monitor the upgrade events in Event Grid and push them to Teams. Limitation: the window is best effort and should not be treated as a guarantee.

Case 2: CVE emergency, and you can't wait for the weekly image

Problem: a high-severity kernel vulnerability was disclosed. Fix: switch the Linux pool to SecurityPatch. Most patches apply online. Kernel patches that need a reboot are reimaged within the window. Confirm the patch date through the suffix of the kubernetes.azure.com/node-image-version label. Limitations: SecurityPatch is not supported on Windows pools. If the organization has a deny policy requiring CMK for the OS disk, you get RequestDisallowedByPolicy and must use NodeImage.

Case 3: year-end business freeze

Problem: changes are prohibited from December 20 to January 4. Fix: add notAllowedDates to both maintenance configurations. Finish the upgrades by hand one week before the freeze, so the freeze period does not end up needing a platform-initiated upgrade. Limitation: urgent reactive maintenance can still happen.

Common errors and fixes

A maintenance window is configured, but auto-upgrade never happens

Cause: the window is shorter than 4 hours; the configuration was created or changed less than 15 minutes before the start; the channel is none; the cluster was Stopped when the window started; the cluster is no longer supported (auto-upgrade no longer applies); or there is no upgrade target.

az aks show -g $RG -n $OPS --query "{auto:autoUpgradeProfile,power:powerState.code,ver:currentKubernetesVersion}"
az aks maintenanceconfiguration list -g $RG --cluster-name $OPS -o table
az aks get-upgrades -g $RG -n $OPS -o table
Why was one of my agent pools upgraded outside the maintenance window?

Cause: operations that started before the window ended continue until they finish, or it is a platform-initiated upgrade or emergency maintenance.

az monitor activity-log list -g $RG --offset 3d --query "[?contains(operationName.value,'agentPools')].{time:eventTimestamp,op:operationName.value,caller:caller}" -o table

Fix: move the window start earlier and extend the duration. For large pools, increase maxSurge to shorten each operation.

RequestDisallowedByPolicy during SecurityPatch upgrade (copy-… VMSS)

Cause: SecurityPatch temporarily creates a VMSS with a copy- prefix, which is rejected by a deny policy requiring CMK encryption of the OS disk.

Fix: add a policy exemption to the node resource group, or switch to the NodeImage channel.

Cannot change nodeOsUpgradeChannel: cluster autoupgrade channel is node-image

Cause: when the cluster channel is the legacy node-image, the node OS channel is locked to NodeImage.

az aks update -g $RG -n $OPS --auto-upgrade-channel stable --node-os-upgrade-channel SecurityPatch
Command-line tasks
1. Create a node OS maintenance window that starts every two weeks on Saturday at 23:00, lasts 5 hours, and uses UTC-05:00.
az aks maintenanceconfiguration add -g $RG --cluster-name $OPS --name aksManagedNodeOSUpgradeSchedule --schedule-type Weekly --day-of-week Saturday --interval-weeks 2 --duration 5 --utc-offset -05:00 --start-time 23:00
2. Use one command to output the current and latest available node image for each pool.
for p in $(az aks nodepool list -g $RG --cluster-name $OPS --query "[].name" -o tsv); do echo "$p $(az aks nodepool show -g $RG --cluster-name $OPS -n $p --query nodeImageVersion -o tsv) -> $(az aks nodepool get-upgrades -g $RG --cluster-name $OPS --nodepool-name $p --query latestNodeImageVersion -o tsv)"; done
Scenario analysis
The security team requires all nodes to get high-severity patches within 7 days. The platform team requires no reimages on weekdays. The cluster has a Windows pool. How would you design this?

Linux pool: node OS channel SecurityPatch (most patches apply online, with reimage when necessary) + an aksManagedNodeOSUpgradeSchedule weekend window to meet the 7-day target. Windows pools do not support SecurityPatch, and the node OS channel is a cluster-level setting, so you can choose NodeImage for them. Windows images are released monthly, so if you cannot meet 7 days, run --node-image-only manually for urgent CVEs. Note that the channel is per cluster. If different pools must follow different policies, consider splitting the cluster or orchestrating the upgrades manually in the pipeline. Audit each run with Event Grid or the activity log.

Verified teaching videos

▶
AKS Node Images Upgrade — Houssem Dellai
English voice · demonstrates node image upgrades. The latest default for the node OS channel follows this lesson.
▶
AKS Patching and Node Pool Upgrade Azure Kubernetes Services (AKS) explained in plain English — cloud-monk - cloud in plain english
English voice · conceptual overview, good for reviewing “patches vs version upgrades”

Official documentation

Video storyboard (about 90 seconds)

This lesson cannot directly generate a video or MP3, so a storyboard and narration script are provided instead.

Shot 1 · 0–20s
Visual: two conveyor belts. The top one says “Kubernetes version,” and the bottom one says “node image.” Each has a gear labeled “channel.”
Narration: AKS has two separate auto-upgrade channels. One upgrades the Kubernetes version, and the other updates the node operating system image.
Shot 2 · 20–45s
Visual: the top gear is set to patch, stable, and rapid. Arrows point to different version numbers.
Narration: patch upgrades only patch versions. stable moves to the second-newest minor version. rapid tracks the latest version.
Shot 3 · 45–70s
Visual: the bottom gear is set to NodeImage (a new disk every week) and SecurityPatch (shield, online patching).
Narration: NodeImage replaces the image every week. SecurityPatch delivers security patches faster, and in most cases you do not need to rebuild the nodes.
Shot 4 · 70–90s
Visual: two colored time blocks on a calendar. A red arrow labeled “urgent maintenance / platform-initiated upgrade” goes around the calendar.
Narration: Maintenance configurations decide when work runs, and a window lasts at least four hours. Urgent maintenance and platform-initiated upgrades can ignore the window.
or score ≥ 70% on the quiz

Module 4 · Observability: Container Insights and Managed Prometheus

21:00 – 28:00 · Metrics go to an Azure Monitor workspace, and logs go to Log Analytics. Two agents, two pipelines.
7 minManaged Prometheus GAContainer Insights (ContainerLogV2)★★★★☆
Learning objectives
  • Draw the two data pipelines: ama-metrics (Prometheus scraping → Azure Monitor workspace → Grafana and PromQL alerts) and ama-logs (stdout/stderr, Kubernetes manifests, performance → DCR → Log Analytics).
  • Use the CLI to enable Managed Prometheus (--enable-azure-monitor-metrics, with optional control plane metrics) and Container Insights (az aks enable-addons --addon monitoring), and verify the agents.
  • Control log costs with the cost presets (Logs and Events / Standard / Cost-optimized / Syslog) and dataCollectionSettings.
  • For the details, study Prometheus & Grafana hour 3: scrape configs, recording rules, alerting rules, and Grafana.
Prerequisite: Prometheus basics (Prometheus Hour 1). Importance: ★★★★☆

What: the Kubernetes monitoring components in Azure Monitor

ComponentWhat it collectsStorageIn-cluster agent
Managed Prometheus (Azure Monitor managed service for Prometheus)Prometheus metrics: kubelet/cAdvisor, kube-state-metrics, node-exporter, and the application metrics you configure. Optional API server and etcd control plane metrics.Azure Monitor workspace (if not specified, the default workspace in the resource group is used or created)ama-metrics (ReplicaSet), ama-metrics-ksm, ama-metrics-node (DaemonSet); on Windows, ama-metrics-win-node
Container Insights (container logs and inventory)Container stdout/stderr, Kubernetes events, Pod and node inventory, performance data, optional SyslogLog Analytics workspace: ContainerLogV2, KubeEvents, KubePodInventory, Perf, InsightsMetrics…ama-logs (DaemonSet), ama-logs-rs (Deployment), ama-logs-windows
Azure Managed Grafana (or Grafana dashboards in the Azure portal)Visualization—None (linked to the Azure Monitor workspace)
Resource logs (diagnostic settings)Control plane logs (Module 5)Log Analytics / storage account / Event HubsNone (emitted from the AKS side)

Both agents are driven by data collection rules (DCR). The DCR is associated with the cluster (DCRA), and the agents read it to decide what to collect and where to send it. So changing collection settings usually means editing the DCR or a ConfigMap (such as ama-metrics-settings-configmap), not the DaemonSet.

Why: why not self-host Prometheus + Loki

  • Managed storage: no need to maintain Prometheus persistent volumes, high availability, or long-term storage. PromQL and Grafana are compatible.
  • Azure integration: Entra authentication, Azure Monitor alerts, and Defender and Copilot diagnostics all use the same data.
  • Trade-offs: billing is based on ingestion (samples / GB), and custom scraping must follow ConfigMap conventions. Some advanced uses, such as remote write to multiple backends, need extra configuration. For a detailed comparison, see Prometheus & Grafana hour 3.

How: log cost presets

PresetFrequencyNamespace filteringData collected
Logs and Events (default)1mNoneContainerLogV2, KubeEvents, KubePodInventory (recommended when you already have Managed Prometheus)
Standard1mNoneAll standard Container Insights tables (needed for the portal's default visualizations)
Cost-optimized5mExclude kube-system, gatekeeper-system, azure-arcAll standard tables
Syslog1mNoneAll standard tables + Syslog

Fields in dataCollectionSettings.json: interval (1m–30m), namespaceFilteringMode (Off/Include/Exclude), namespaces, enableContainerLogV2 (default true), streams. ContainerLogV2 supports the Basic logs table plan, which can cut costs significantly (with limited query capabilities).

When: the smallest production-ready combination

  • Metrics: Managed Prometheus (+ control plane metrics) + recommended alert rules + Grafana.
  • Logs: the Container Insights “Logs and Events” preset + ContainerLogV2 + Exclude for noisy namespaces.
  • Control plane: diagnostic settings (Module 5).
  • During upgrades, focus on: ready node count, Pod restarts, kube_pod_status_ready, API server latency and 5xx responses, and PDB disruptions_allowed (the kube-state-metrics metric kube_poddisruptionbudget_status_pod_disruptions_allowed).
Common misconceptions ① “Enabling Container Insights gives you Prometheus metrics.” No. The two are enabled separately and stored separately. ② “The Insights views in the portal are all available if you only pick the Logs and Events preset.” No. The default visualizations require the Standard (All) grouping. ③ “Managed Prometheus metrics live in Log Analytics.” No. They live in the Azure Monitor workspace and are queried with PromQL. ④ “Namespace filtering also filters ama-logs' own logs.” No, it does not.

Architecture diagram: two data pipelines

AKS cluster (kube-system) ama-metricsRS: scrapes cluster-level targetsama-metrics-ksmama-metrics-node (DS)kubelet/cAdvisor/node ama-logs (DS)Reads /var/log/containersama-logs-rs (Deployment)K8s manifests / events Configuration sourceDCR + DCRA (Azure side)ama-metrics-settings-configmap / prometheus-configcontainer-azm-ms-agentconfig Azure Monitor workspacePrometheus time series (PromQL) Log Analytics workspaceContainerLogV2 · KubeEvents… (KQL) Managed GrafanaDashboards Prometheus alert rules→ Action Group Log search alertsWorkbooks / Insights Control plane: AKS side → diagnostic settings → Log Analytics (Module 5)Control plane metrics: --enable-control-plane-metrics → the same Azure Monitor workspace
Figure 4-1: metrics and logs take different agents and different storage. The DCR is the shared “configuration center” for both.

Upgrade observability: which signals to watch during an upgrade

Nodeskube_node_status_conditionkube_node_spec_unschedulableKubeNodeInventoryEvents: Surge / Drain / Upgrade Workloadskube_pod_status_readykube_deployment_status_replicas_availablePDB disruptions_allowed ApplicationsRequest 5xx ratioP99 latencyErrors in ContainerLogV2 Control planeapiserver_request_total(control plane metrics)AKSControlPlane logs
Figure 4-2: inspection dashboard during the upgrade soak: nodes → workloads → applications → control plane

Data flow animation: the journey of one metric sample and one log line

Choose “Metrics” or “Logs” and step through each hop from container to storage to query. The terminal shows the real object or query for each hop.

Select a data type, then click “Next step.”
$ kubectl get pods -n kube-system -l rsName=ama-metrics

Core commands

CommandPurposeKey parameters
az aks update --enable-azure-monitor-metricsEnable Managed Prometheus--azure-monitor-workspace-resource-id, --grafana-resource-id, --enable-control-plane-metrics, --ksm-metric-labels-allow-list
az aks update --disable-azure-monitor-metricsDisable Managed Prometheus—
az aks enable-addons --addon monitoringEnable Container Insights--workspace-resource-id, --data-collection-settings
az aks disable-addons --addon monitoringDisable—
kubectl get ds ama-logs ama-metrics-node -n kube-systemVerify agentsDESIRED should equal the number of Linux nodes

1) Create a workspace and enable Managed Prometheus (including control plane metrics)

az monitor account create -g $RG -n amw-aks-lab -l $LOC          # Azure Monitor workspace
AMW_ID=$(az monitor account show -g $RG -n amw-aks-lab --query id -o tsv)
az aks update -g $RG -n $OPS --enable-azure-monitor-metrics \
  --azure-monitor-workspace-resource-id $AMW_ID --enable-control-plane-metrics
kubectl get rs -n kube-system | grep ama-metrics
kubectl get ds ama-metrics-node -n kube-system
ama-metrics-5c974985b8          1         1         1       3m
ama-metrics-ksm-5fcf8dffcd      1         1         1       3m
NAME               DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   AGE
ama-metrics-node   5         5         5       5            5           3m

To also link Azure Managed Grafana, add --grafana-resource-id $GRAFANA_ID. This requires Owner, or Contributor plus User Access Administrator, on Grafana. For Grafana details and PromQL, see Prometheus & Grafana hour 3.

2) Create a Log Analytics workspace and enable Container Insights (custom collection)

{
  "interval": "1m",
  "namespaceFilteringMode": "Exclude",
  "namespaces": ["kube-system", "gatekeeper-system"],
  "enableContainerLogV2": true,
  "streams": ["Microsoft-ContainerLogV2", "Microsoft-KubeEvents", "Microsoft-KubePodInventory"]
}
az monitor log-analytics workspace create -g $RG -n law-aks-lab -l $LOC
LAW_ID=$(az monitor log-analytics workspace show -g $RG -n law-aks-lab --query id -o tsv)
az aks enable-addons -g $RG -n $OPS --addon monitoring \
  --workspace-resource-id $LAW_ID --data-collection-settings dataCollectionSettings.json
kubectl get ds ama-logs -n kube-system
kubectl get deployment ama-logs-rs -n kube-system
NAME       DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
ama-logs   5         5         5       5            5           <none>          2m
NAME          READY   UP-TO-DATE   AVAILABLE   AGE
ama-logs-rs   1/1     1            1           2m

3) Verify data (after 10–15 minutes)

ContainerLogV2
| where TimeGenerated > ago(30m)
| where PodNamespace == "myapp"
| summarize lines = count() by PodName, LogLevel
| order by lines desc
sum by (namespace) (kube_pod_status_ready{condition="true", namespace="myapp"})
kube_poddisruptionbudget_status_pod_disruptions_allowed{namespace="myapp"}

How to verify: in the portal, go to the cluster → Monitoring → Insights / Metrics, or run PromQL in the Prometheus explorer of the Azure Monitor workspace. Common error: agent Pods in CrashLoopBackOff, usually because outbound traffic is blocked by a firewall. Allow the Azure Monitor FQDNs. See the outbound rules in hour 2.

Lab 4: Enable both pipelines and observe during an upgrade (about 15 minutes, plus time for data to arrive)

Cost: the Azure Monitor workspace is billed by ingested samples, and Log Analytics by GB. This lab's data volume is small (usually < $1/day), but be sure to delete the workspace or turn off the add-ons during cleanup. Permissions: Contributor on the resource group. Linking Grafana requires extra role assignment permissions.

Enable Managed Prometheus (command tab 1)
Enable Container Insights (command tab 2, using a custom dataCollectionSettings)
Generate some logs and events
for i in $(seq 1 50); do kubectl exec -n myapp prober -- curl -s http://myapp.myapp/ >/dev/null; done
kubectl rollout restart deploy/myapp -n myapp
Query events: what happened during the upgrade or restart
KubeEvents
| where TimeGenerated > ago(1h)
| where Namespace == "myapp" or Reason in ("Drain","Surge","Upgrade")
| project TimeGenerated, Namespace, Name, Reason, Message
| order by TimeGenerated desc
(Optional) Do a node image upgrade and watch the PromQL curves
az aks nodepool upgrade -g $RG --cluster-name $OPS -n apppool --node-image-only --no-wait
sum(kube_node_spec_unschedulable)
min_over_time(kube_poddisruptionbudget_status_pod_disruptions_allowed{namespace="myapp"}[5m])

Verify: you can see myapp's logs in Log Analytics, and in PromQL you can see the number of ready myapp Pods briefly drop to 3 during the drain. Cleanup: delete everything together after Module 8. To turn off only these features: az aks disable-addons -g $RG -n $OPS --addon monitoring and az aks update -g $RG -n $OPS --disable-azure-monitor-metrics.

Case 1: the Log Analytics bill grew 5x in one month

Problem: one team sent debug logs to stdout, and Container Insights collects everything by default. Fix: enable ContainerLogV2 and set the table to Basic logs; exclude by namespace; lower the log level for noisy workloads; set a daily cap alert on the workspace. Limitation: Basic logs have limited query and alerting capabilities. For retention and pricing, see the Azure Monitor docs.

Case 2: replace a self-managed kube-prometheus-stack with Managed Prometheus

Problem: the PVs for the self-managed Prometheus keep filling up, and upgrading the chart is risky. Fix: enable Managed Prometheus and Managed Grafana, and migrate custom scrape configs to the ama-metrics-prometheus-config ConfigMap or to PodMonitor/ServiceMonitor (the managed version uses the azmonitoring.coreos.com CRD group). Limitation: alert rules must be migrated to Azure Monitor Prometheus rule groups. For details, see Prometheus & Grafana hour 3.

Case 3: an upgrade outage nobody can see

Problem: after each node image upgrade, customers reported sporadic 502 errors, but the dashboard averages looked normal. Fix: overlay the upgrade events (Drain and Surge from KubeEvents) as Grafana annotations on the 5xx curve. This revealed that the app lacked a preStop hook, so traffic still reached Pods being deleted. Limitation: events have a retention period, so long-term analysis depends on Log Analytics.

Common errors and fixes

ama-metrics / ama-logs Pod in CrashLoopBackOff, or 403 / connection timed out in the logs

Cause: outbound traffic is blocked by a firewall or UDR, or the cluster's managed identity lacks permissions on the DCR or workspace (usually configured automatically by the add-on).

kubectl logs -n kube-system -l rsName=ama-metrics -c prometheus-collector --tail=50
kubectl logs -n kube-system ds/ama-logs -c ama-logs --tail=50

Fix: allow the Azure Monitor endpoints per the AKS outbound rules, such as *.ingest.monitor.azure.com and *.handler.control.monitor.azure.com. The official outbound rules docs are the source of truth. Or use AMPLS private link.

Insights page is blank: “No data for selected filters”

Cause: the Logs and Events preset was selected (it does not include Perf or InsightsMetrics), or the data has not arrived yet. The first run takes 5–15 minutes.

Fix: switch to the Standard preset, or use Managed Prometheus and Grafana dashboards to view performance.

PromQL cannot find custom application metrics

Cause: by default, only kubelet, cAdvisor, kube-state-metrics, node-exporter, and similar targets are scraped. Application metrics must be configured explicitly.

kubectl get configmap -n kube-system | grep ama-metrics

Fix: use ama-metrics-prometheus-config or the managed CRDs (PodMonitor/ServiceMonitor). See Prometheus & Grafana hour 3.

enable-addons fails with an error related to the workspace's subscription or region

Cause: missing permissions, or resource providers not registered (such as Microsoft.Insights, Microsoft.OperationalInsights, Microsoft.Monitor).

az provider show -n Microsoft.Monitor --query registrationState
az provider register -n Microsoft.Monitor
Command-line tasks
1. On a cluster with Managed Prometheus enabled, add control plane metrics collection.
az aks update -g $RG -n $OPS --enable-control-plane-metrics
2. Write a KQL query that counts logs containing “error” in the myapp namespace over the past hour, grouped by Pod.
ContainerLogV2
| where TimeGenerated > ago(1h) and PodNamespace == "myapp"
| where tostring(LogMessage) has "error"
| summarize count() by PodName
Scenario analysis
Finance requires cutting monitoring costs by 50%, but the SRE team does not want to lose visibility during upgrades. How would you adjust?

① Move performance metrics entirely to Managed Prometheus, which is billed by samples and is usually cheaper than sending Perf data to Log Analytics. Set Container Insights to the “Logs and Events” preset. ② Enable ContainerLogV2 and set it to Basic logs, exclude noisy namespaces, and lower the log level in apps. ③ For the control plane, collect only kube-audit-admin, not kube-audit (Module 5). ④ Keep KubeEvents (the source of upgrade events) and kube-state-metrics (PDB and Ready counts). These are the core of upgrade visibility, and their data volume is small.

Verified teaching videos

▶
AKS Labs: Observability with Managed Prometheus and Managed Grafana — Azure Kubernetes Service (AKS)
English voice · hands-on lab from the official AKS channel, closest to this module's content
▶
Azure Managed Prometheus and Grafana for AKS monitoring — Houssem Dellai
English voice · demonstration of enabling and querying
▶
How Prometheus Monitoring works | Prometheus Architecture explained — TechWorld with Nana
English voice · review of Prometheus architecture basics

Official documentation

Video storyboard (about 80 seconds)

This lesson cannot directly generate a video or MP3, so a storyboard and narration script are provided instead.

Shot 1 · 0–20s
Visual: one node with two agent icons: a green ama-metrics and a blue ama-logs.
Narration: AKS monitoring has two pipelines. The Managed Prometheus agent scrapes metrics, and the Container Insights agent collects logs and events.
Shot 2 · 20–45s
Visual: green data points fly to the “Azure Monitor workspace” and then to Grafana. Blue log lines fly to “Log Analytics.”
Narration: Metrics live in the Azure Monitor workspace and are queried with PromQL. Logs live in Log Analytics and are queried with KQL.
Shot 3 · 45–65s
Visual: a gear labeled DCR connects both agents.
Narration: What to collect and where to send it is decided by the data collection rule.
Shot 4 · 65–80s
Visual: the cost dashboard needle drops. Next to it are the ContainerLogV2 and Basic logs labels.
Narration: Use cost presets, namespace filtering, and Basic logs to control log costs.
or score ≥ 70% on the quiz

Module 5 · Logs, diagnostic settings and control plane logs

28:00 – 35:00 · The control plane runs on the AKS side. You can't see its Pods, so you can only learn what it reports through resource logs.
7 minresource-specific modekube-audit is costly★★★★☆
Learning objectives
  • Distinguish the four kinds of AKS logs: activity log (ARM operations), resource logs (control plane, requires diagnostic settings), container logs (Container Insights), and Kubernetes events.
  • List the resource log categories (kube-apiserver, kube-audit, kube-audit-admin, kube-controller-manager, kube-scheduler, cluster-autoscaler, cloud-controller-manager, guard, CSI controllers, and so on). Know the cost difference between kube-audit and kube-audit-admin.
  • Use az monitor diagnostic-settings create --export-to-resource-specific true to send logs to the AKSControlPlane, AKSAudit, and AKSAuditAdmin tables, and set the audit table to Basic logs.
  • Write common KQL: who deleted a resource, sources of 403s, cluster-autoscaler decisions, and upgrade-related activity logs.
Prerequisites: Kubernetes audit log concepts, KQL basics. Importance: ★★★★☆ (key evidence for incident reviews and compliance audits)

What: where the four kinds of logs come from

TypeContentCollected by default?Where to view
Activity logARM-level operations: create, upgrade, or stop a cluster; modify a node pool; who made the callYes (subscription level, retained for 90 days)Portal Activity log; can be exported to Log Analytics through diagnostic settings
Resource logs (control plane)kube-apiserver, audit, controller-manager, scheduler, autoscaler…No. You must create a diagnostic setting.Log Analytics (AzureDiagnostics or AKS* tables), storage account, Event Hubs
Container logsYour app's stdout/stderrAfter enabling Container InsightsContainerLogV2
Kubernetes eventsScheduled, Killing, FailedScheduling, Drain, Surge…Kept only briefly in the API server (upstream --event-ttl defaults to 1 hour; AKS's actual setting should be confirmed by observation)kubectl get events; KubeEvents table (Container Insights)

Resource log categories (selectable in diagnostic settings)

CategoryContentRecommendation
kube-apiserverAPI server logsOn (for troubleshooting webhook and authentication issues)
kube-auditAll audit events (including get, list, and watch)Very high volume. Usually don't enable, or enable only briefly.
kube-audit-adminAudit events, excluding get and listOn (the main source for change auditing)
kube-controller-managerController logsAs needed
kube-schedulerScheduler logsAs needed
cluster-autoscalerScaling decisions (why it scaled or didn't)Enable when CA is on
cloud-controller-managerCloud resource operations such as LoadBalancer and routingWhen troubleshooting Service external IP issues
guardEntra ID / Azure RBAC authorization (Guard webhook)Enable when Entra integration is on
csi-azuredisk-controller, csi-azurefile-controller, csi-snapshot-controllerStorage CSI controllersWhen troubleshooting PVs

For the complete category list, see the AKS monitoring data reference, which is the source of truth. The list grows as new components are added.

How: two collection modes

ModeWhere it writesPros and cons
Azure diagnostics modeEverything goes to the AzureDiagnostics table, distinguished by Category. The content is in the log_s string and needs parse_json.Legacy approach. The table has a column limit, and Basic logs cannot be used.
Resource-specific mode (recommended)AKSControlPlane (non-audit categories), AKSAudit (kube-audit), AKSAuditAdmin (kube-audit-admin)Structured columns and simpler queries. Supports Basic logs for major cost savings.

Why: common problems and the logs that answer them

  • “Who deleted the myapp Deployment in the middle of the night?” → AKSAuditAdmin (verb=delete).
  • “Why didn't the node pool scale out?” → AKSControlPlane, Category=cluster-autoscaler.
  • “Who upgraded the cluster? Was it auto-upgrade or a person?” → activity log (caller, operationName).
  • “Why does kubectl return 403?” → guard and ResponseStatus in the audit log.
  • “Where did the upgrade drain get stuck?” → KubeEvents (Drain) plus pods/eviction requests and their 429 responses in the audit log.

When: cost and retention

  • Resource logs are billed by Log Analytics ingestion. kube-audit is the largest cost driver. Official guidance: turn it off if you don't need it, use kube-audit-admin instead, and set the AKSAudit table to Basic logs.
  • For long-term compliance retention, export additionally to a storage account (cheap), or use the workspace's long-term retention (archive).
  • Creating a diagnostic setting with the CLI does not check the cluster's provisioning state, so confirm it took effect after creation.
Common misconceptions ① “AKS has API server logs by default.” No. Without a diagnostic setting, there are no resource logs. ② “kube-audit-admin doesn't include delete.” It only excludes get and list. ③ “kubectl get events can show yesterday's upgrade events.” Events expire quickly, so use the KubeEvents table. ④ “You can see kubectl operations in the activity log.” The activity log records only ARM operations. kubectl operations are in the audit log.

Architecture diagram: where logs are generated, what they pass through, and where they land

AKS managed control plane kube-apiserver (including audit)kube-controller-managerkube-scheduler · cluster-autoscalercloud-controller-manager · guardcsi-*-controller Diagnostic settingsSelect categories and destination--export-to-resource-specific Log Analytics workspaceAKSControlPlane (non-audit categories)AKSAudit (kube-audit) → Basic logsAKSAuditAdmin (kube-audit-admin)Or AzureDiagnostics (legacy mode)+ ContainerLogV2 / KubeEvents (Module 4) Storage account (archive) Event Hubs → SIEM ARM (Azure Resource Manager)Activity log: upgrade / stop / nodepool→ can be exported through subscription diagnostic settings
Figure 5-1: control plane logs can only be exported through diagnostic settings. Resource-specific mode writes to three dedicated AKS tables.

Structure of one audit event (key columns of AKSAuditAdmin)

TimeGenerated 2026-11-16T03:12:44Z Verb delete Level RequestResponse/Metadata User {"username":"alice@contoso.com","groups":[...]} SourceIps ["203.0.113.10"] ObjectRef {"resource":"deployments","namespace":"myapp","name":"myapp","apiGroup":"apps"} ResponseStatus {"code":200} UserAgent kubectl/v1.36.x → Eviction request: ObjectRef.resource="pods", subresource="eviction". When a PDB rejects it, ResponseStatus.code=429.
Figure 5-2: the most commonly used columns in audit events. Column names follow the AKSAuditAdmin table schema; example values are fictional.

Animation: the audit log journey of one kubectl delete deployment

Step through how the request passes authentication, authorization, and admission, gets written to the audit backend, enters the AKSAuditAdmin table through diagnostic settings, and is finally found with KQL. Switch “categories” to see the difference between kube-audit and kube-audit-admin.

Diagnostic setting categories: Request:
Select categories and a request to start.
$ kubectl delete deployment myapp -n myapp

Core commands

CommandPurposeKey parameters
az monitor diagnostic-settings categories list --resource IDList the log categories supported by this cluster—
az monitor diagnostic-settings createCreate a diagnostic setting--logs JSON, --workspace, --export-to-resource-specific true, --storage-account, --event-hub
az monitor diagnostic-settings list/show/deleteManage--resource
az monitor log-analytics workspace table update --plan BasicChange tables to Basic logs--name AKSAudit
az monitor activity-log listQuery ARM activity logs--resource-group, --offset, --caller

1) Create a diagnostic setting (resource-specific, using kube-audit-admin for auditing)

AKS_ID=$(az aks show -g $RG -n $OPS --query id -o tsv)
LAW_ID=$(az monitor log-analytics workspace show -g $RG -n law-aks-lab --query id -o tsv)
az monitor diagnostic-settings categories list --resource $AKS_ID --query "value[].name" -o tsv

az monitor diagnostic-settings create --name aks-diag --resource $AKS_ID \
  --workspace $LAW_ID --export-to-resource-specific true \
  --logs '[{"category":"kube-apiserver","enabled":true},
           {"category":"kube-audit-admin","enabled":true},
           {"category":"kube-controller-manager","enabled":true},
           {"category":"kube-scheduler","enabled":true},
           {"category":"cluster-autoscaler","enabled":true},
           {"category":"cloud-controller-manager","enabled":true},
           {"category":"guard","enabled":true}]'
az monitor diagnostic-settings show --name aks-diag --resource $AKS_ID --query "{dest:logAnalyticsDestinationType, logs:logs[?enabled].category}"
{
  "dest": "Dedicated",
  "logs": ["kube-apiserver","kube-audit-admin","kube-controller-manager","kube-scheduler","cluster-autoscaler","cloud-controller-manager","guard"]
}

logAnalyticsDestinationType: Dedicated means resource-specific mode.

2) Set the audit table to Basic logs (if kube-audit is enabled)

az monitor log-analytics workspace table update -g $RG --workspace-name law-aks-lab --name AKSAudit --plan Basic

3) Common KQL

// Who deleted or modified objects in the myapp namespace
AKSAuditAdmin
| where TimeGenerated > ago(24h)
| where Verb in ("delete","patch","update","create")
| where ObjectRef.namespace == "myapp"
| project TimeGenerated, Verb, User = tostring(User.username), Resource = tostring(ObjectRef.resource), Name = tostring(ObjectRef.name), Code = toint(ResponseStatus.code), UserAgent
| order by TimeGenerated desc
// Evictions rejected by a PDB during the upgrade (429)
AKSAuditAdmin
| where TimeGenerated > ago(6h)
| where ObjectRef.subresource == "eviction" and toint(ResponseStatus.code) == 429
| summarize rejected = count() by Ns = tostring(ObjectRef.namespace), Pod = tostring(ObjectRef.name)
| order by rejected desc
// cluster-autoscaler decisions
AKSControlPlane
| where Category == "cluster-autoscaler"
| where Message has_any ("scale-up", "ScaleUp", "NotTriggerScaleUp")
| project TimeGenerated, Message
| take 50
# Who upgraded or stopped the cluster, and when (ARM activity log)
az monitor activity-log list -g $RG --offset 7d \
  --query "[?resourceType.value=='Microsoft.ContainerService/managedClusters' || contains(resourceId,'agentPools')].{time:eventTimestamp,op:operationName.localizedValue,status:status.value,caller:caller}" -o table

How to verify: run kubectl label ns myapp audit-test=1, then find the verb=patch record in AKSAuditAdmin 5–10 minutes later. Common errors: querying AzureDiagnostics while using resource-specific mode (or the reverse). Fields are dynamic type, so apply tostring() before comparing.

Lab 5: Create a diagnostic setting and answer “who did what” (about 15 minutes)

Cost: kube-audit-admin on a small cluster is usually tens of MB per day. Do not leave kube-audit on for long during the lab. Security: audit logs include usernames and source IPs, so grant Log Analytics Reader on the workspace only to people who need it.

Create the diagnostic setting (command tab 1)
Make changes
kubectl scale deploy/myapp -n myapp --replicas=5
kubectl label ns myapp owner=platform --overwrite
kubectl delete pod -n myapp -l app=myapp --wait=false | head -1
Query 10 minutes later (the first KQL on command tab 3). Confirm you see three kinds of records with your username: scale (resource=deployments, subresource=scale), patch namespaces, and delete pods.
Query upgrade activity: use the activity log to view the upgrade and agentPools/write operations from Module 2, along with the caller and the start and end times.
Roll back the replica count
kubectl scale deploy/myapp -n myapp --replicas=4

Cleanup: at the end of the course, run az monitor diagnostic-settings delete --name aks-diag --resource $AKS_ID. Deleting the cluster also deletes its diagnostic settings.

Case 1: a production namespace was deleted by mistake

Problem: a CI service principal ran kubectl delete ns. Fix: AKSAuditAdmin shows the User (service principal objectId), SourceIps (CI runner), and UserAgent. Combine this with the activity log and Entra sign-in logs to locate the pipeline. Remediation: narrow Azure RBAC to namespace scope, and enable Deployment Safeguards and Azure Policy. Limitation: clusters without kube-audit-admin enabled cannot reconstruct what happened.

Case 2: audit logs reach 80 GB per day

Problem: kube-audit was enabled, and one operator was listing all Pods across the cluster every second. Fix: switch to kube-audit-admin (which excludes get and list). If AKSAudit must be kept, set it to Basic logs. Fix the operator's informer usage. Limitation: auditing read access (who read a Secret) requires kube-audit. Enable it only briefly, or export it to a storage account.

Case 3: SIEM integration

Problem: the security team uses Splunk or Sentinel. Fix: the same diagnostic setting sends data to both an Event Hub (SIEM) and Log Analytics (operations). Microsoft Sentinel can read the workspace directly. Limitation: each resource has a limit on the number of diagnostic settings (see the Azure Monitor docs), so avoid having each team create its own.

Common errors and fixes

Diagnostic setting created, but the AKSControlPlane and AKSAuditAdmin tables are empty

Cause: the first data takes 10–15 minutes. The setting may have been created in Azure diagnostics mode (data goes to AzureDiagnostics). The category may not be enabled, or the cluster may be Stopped.

az monitor diagnostic-settings show --name aks-diag --resource $AKS_ID --query logAnalyticsDestinationType
AzureDiagnostics | where ResourceType == "MANAGEDCLUSTERS" | summarize count() by Category
(BadRequest) Category 'kube-audit-admins' is not supported.

Cause: the category name is misspelled. The correct name is kube-audit-admin.

az monitor diagnostic-settings categories list --resource $AKS_ID --query "value[].name" -o tsv
KQL error: Failed to resolve scalar expression named 'log_s'

Cause: the AzureDiagnostics query syntax was used on a resource-specific table.

Fix: AKS* tables already have structured columns, so use Verb, ObjectRef, User, and so on directly.

Log Analytics cost spike
Usage
| where TimeGenerated > ago(7d)
| summarize GB = sum(Quantity) / 1024 by DataType
| order by GB desc

Fix: turn off kube-audit, set AKSAudit to Basic logs, and filter ContainerLogV2 (Module 4).

Command-line tasks
1. List all diagnostic settings on the cluster and their destination modes.
az monitor diagnostic-settings list --resource $AKS_ID --query "[].{name:name,mode:logAnalyticsDestinationType,ws:workspaceId}" -o table
2. KQL: over the past 24 hours, count write operations on Secrets (create, update, patch, delete) by user.
AKSAuditAdmin
| where TimeGenerated > ago(24h)
| where ObjectRef.resource == "secrets" and Verb in ("create","update","patch","delete")
| summarize count() by User = tostring(User.username), Verb
Scenario analysis
Auditing requires recording “who read Secrets,” while finance requires controlling costs. How would you design this?

Reads (get and list) appear only in kube-audit. kube-audit-admin does not include them. Options: enable kube-audit but send it only to a storage account (a low-cost archive that meets retention requirements), while Log Analytics receives only kube-audit-admin. Or send kube-audit to the resource-specific AKSAudit table and set it to Basic logs. Also reduce the number of principals that need to read Secrets (use Key Vault CSI and Workload Identity, see hour 3).

Verified teaching videos

▶
Understanding Key Components of AKS Monitoring — Lionel Gurret
English voice · overview of AKS monitoring components, including diagnostic settings
▶
Azure Monitor, Log Analytics, Diagnostic settings — Florian Trippel
English voice · introduction to general Azure diagnostic settings and Log Analytics (not AKS-specific)

No verified video dedicated to the AKS audit tables (AKSAuditAdmin) was found, so a storyboard is provided below.

Official documentation

Video storyboard (about 80 seconds)

This lesson cannot directly generate a video or MP3, so a storyboard and narration script are provided instead.

Shot 1 · 0–20s
Visual: a cloud labeled “managed control plane,” with its components locked and out of sight.
Narration: AKS's control plane is managed by Microsoft. You can't see its Pods, so you can only export its logs through diagnostic settings.
Shot 2 · 20–45s
Visual: the diagnostic settings panel, with kube-apiserver and kube-audit-admin checked. A huge money bag sits next to kube-audit.
Narration: Audit logs are the most valuable and also the most expensive. kube-audit-admin excludes read operations, which makes it the first choice for most teams.
Shot 3 · 45–65s
Visual: the log stream splits into three tables: AKSControlPlane, AKSAudit, and AKSAuditAdmin.
Narration: With resource-specific mode, logs go into three structured tables. You can also set the audit table to Basic logs to save cost.
Shot 4 · 65–80s
Visual: a KQL result highlights one row: delete deployments myapp by alice.
Narration: When an incident happens, one KQL query can answer who did what, and when.
or score ≥ 70% on the quiz

Module 6 · Cost management: the cost analysis add-on and optimization

35:00 – 42:00 · The bill only knows about VMs, disks, and IPs. Cost analysis turns them into “how much each namespace costs.”
7 minCost analysis add-on (based on OpenCost)Requires Standard/Premium tier · EA/MCA★★★★☆
Learning objectives
  • Explain the components of AKS cost: node VMs (the biggest share), OS and data disks, load balancers and public IPs, outbound traffic, control plane tier (Standard/Premium), monitoring logs, and add-on services such as Defender.
  • Enable the cost analysis add-on (--enable-cost-analysis), understand its prerequisites and limits, and view costs by namespace and asset in Cost Management.
  • Explain the four cost categories, Idle / System / Service / Unallocated, and what “allocated by requests” means.
  • List the optimization options: right-size requests, autoscaling, Spot, stopping dev clusters, reserved instances and savings plans, log costs, and cleaning up orphaned resources.
Prerequisites: requests and limits (K8s Hour 2), Cluster Autoscaler and VPA (hour 4). Importance: ★★★★☆

What: the cost analysis add-on

The add-on deploys an agent in the cluster (cost-agent, based on the CNCF project OpenCost) to collect usage. It reconciles that usage with Azure billing data and shows costs in the Cost Management → Cost analysis → Kubernetes clusters view, broken down by cluster, namespace, and asset (compute, network, storage).

Prerequisites / limitationsDetails
Pricing tierThe cluster must be Standard or Premium (Free is not supported). After enabling, you must disable it before you can downgrade to Free.
Billing typeThe Kubernetes cost view supports only Enterprise Agreement (EA) and Microsoft Customer Agreement (MCA) (pay-as-you-go and MSDN subscriptions can't see it).
Cluster configurationManaged identity; Azure Disk CSI driver; access to the required FQDNs, including ARM; CLI ≥ 2.61.0
ScaleAgent memory is about 200 MB + 0.5 MB per container, capped at 4 GB, supporting about 7,000 containers
Not supportedVirtual nodes; some sovereign cloud regions
LatencyData appears up to 24 hours after enabling. Cost data is usually finalized in 8–24 hours.
IdentityWhen enabled, a managed identity named cost-analysis-identity is created (read-only on the node resource group) and assigned to the node pool. Commands that use the node's managed identity must then specify the identity explicitly.
View permissionsOwner / Contributor / Reader / Cost Management Contributor / Cost Management Reader on the subscription

How: cost categories

Cost typeMeaningTypical optimization
Namespace costNode cost allocated to workloads by their use of node resources (requests and actual usage)Right-size requests (VPA recommendations)
Idle chargesCapacity on a node that no workload is usingCluster Autoscaler / NAP, right-sized VM SKUs, bin-packing
System chargesCapacity that AKS reserves on each node for system processes such as the kubelet and the container runtimeLarger VM sizes spread the fixed reservation further (a trade-off against failure domain size)
Service chargesService-related charges, such as the Uptime SLA (Standard tier) and Defender for ContainersFree tier for non-production (but cost analysis requires Standard)
Unallocated chargesCosts that cannot be allocated to a namespaceClean up orphaned disks and IPs, and tag resources

Why: the three stages of FinOps

  • Inform: cost analysis + tags (--tags costcenter=…; node pool tags propagate to the VMSS) so every dollar has an owner.
  • Optimize: tune requests, scale, use Spot, stop idle clusters, and use reserved instances / Azure savings plans (commit to 1- or 3-year compute usage).
  • Operate: budgets and alerts (Cost Management Budgets), regular reviews (module 8).

When: quick reference for optimization levers

LeverBest forCaveat
Cluster Autoscaler / NAPWorkloads with peaks and troughsRequires accurate requests; see hour 4
Spot node poolInterruptible batch jobs, CICan be evicted; use taints and tolerations
Scale user pool to 0 / az aks stopDev/test clusters outside working hoursStop limitations: see module 7
Reserved instances / savings plansStable baseline capacityPair with autoscaling: only buy for the minimum baseline
Logging costsLog Analytics bill is largeContainerLogV2 + Basic logs and kube-audit-admin from modules 4 and 5
Upgrade surge costLarge pools, frequent upgradesSurge nodes are billed per minute; set maxSurge and the upgrade window sensibly
Common misconceptions ① “Cost analysis is a free feature of the Free tier.” Not so: it requires the Standard or Premium tier, and the Kubernetes view only appears for EA/MCA subscriptions. ② “Idle cost should be as low as possible, ideally zero.” Keep some headroom for scale-out, upgrade surge, and failover. ③ “Stopping the cluster means zero cost.” Disks, public IPs, Log Analytics and similar resources are still billed. ④ “Savings plans and autoscaling conflict.” They don't, as long as the committed amount is ≤ the minimum baseline.

Architecture: where cost data comes from

AKS cluster cost-agent (OpenCost)Pod/namespace usage, requests cost-analysis-identityReads the ARM IDs in the MC_ resource group Azure billing / usage dataVMs, disks, LBs, IPs, SLA… ReconcileUsage × actual price Cost ManagementKubernetes clusters viewNamespaces / assetsIdle · System · Service · Unallocated Data latency: up to 24 hours at first; after that, each day's data is finalized 8–24 hours later
Figure 6-1: in-cluster usage + Azure bill = cost by Kubernetes dimension

How the cost of one node is split (conceptual diagram)

System reserved myapp namespace monitoring / kube-system Idle (unused capacity) The hourly cost of one Standard_D4s_v5 = system reserved + each namespace's share (the larger of requests and actual usage) + idle (the allocation method follows the OpenCost model)
Figure 6-2: idle capacity is often the largest optimization opportunity

Interactive calculator: adjust requests and node count to see how the cost is allocated

Simplified model (for teaching): 4 vCPU per node, 0.3 vCPU system reserved; the hourly cost per node is adjustable; namespace cost is allocated by CPU share of max(requests, actual usage); the remainder is Idle. Real OpenCost also considers CPU, memory, GPU and storage.

Node count 3
Hourly cost per node (USD, example) 0.21
myapp requests (per replica, m) 100m × 4 replicas
myapp actual usage (per replica, m) 60m
batch requests (total vCPU) 2

Core commands

CommandPurposeKey parameters
az aks update --enable-cost-analysisEnable cost analysisCluster must be Standard/Premium (can be used together with --tier standard)
az aks update --disable-cost-analysisDisableMust disable before downgrading to the Free tier
az aks update --tier standard|premium|freeChange pricing tierPremium for LTS
az aks nodepool update --tags / az aks update --tagsCost tagsNode pool tags are applied to the VMSS
az consumption budget createBudgets and alerts (can also be created in the portal under Cost Management)--amount, --time-grain

1) Enable and verify

az aks show -g $RG -n $OPS --query sku.tier -o tsv          # must be Standard or Premium
az aks update -g $RG -n $OPS --enable-cost-analysis
az aks show -g $RG -n $OPS --query "metricsProfile.costAnalysis" -o json
kubectl get pods -n kube-system | grep -i cost
Standard
{
  "enabled": true
}
cost-analysis-agent-7d9f8b6c5d-x2k8p   3/3   Running   0   4m

The exact name of the agent Pod depends on what is actually running in your cluster (the official troubleshooting docs call it cost-agent). Confirm the field path metricsProfile.costAnalysis against the actual output of az aks show.

2) Tag namespaces and node pools with cost labels

kubectl label ns myapp costcenter=cc-1001 team=web --overwrite
az aks nodepool update -g $RG --cluster-name $OPS -n apppool --tags costcenter=cc-1001 env=lab

3) Find over-provisioned workloads (requests far above actual usage)

kubectl top pod -n myapp
kubectl get pod -n myapp -o custom-columns=NAME:.metadata.name,CPU_REQ:.spec.containers[*].resources.requests.cpu,MEM_REQ:.spec.containers[*].resources.requests.memory
# Ratio of CPU requests to actual usage (> 3 indicates over-provisioning)
sum by (namespace) (kube_pod_container_resource_requests{resource="cpu"})
/ sum by (namespace) (rate(container_cpu_usage_seconds_total{container!=""}[30m]))

4) Find orphaned resources (a common source of Unallocated cost)

NODE_RG=$(az aks show -g $RG -n $OPS --query nodeResourceGroup -o tsv)
az disk list -g $NODE_RG --query "[?diskState=='Unattached'].{name:name,size:diskSizeGB}" -o table
az network public-ip list -g $NODE_RG --query "[?ipConfiguration==null].{name:name,ip:ipAddress}" -o table

Common mistakes: enabling it on a Free tier cluster fails with an error; on a pay-as-you-go subscription, enabling succeeds but the Kubernetes view does not appear in the portal. Production use: build showback/chargeback reports by the costcenter tag, and review the idle ratio every month.

Lab 6: enable cost analysis and create one “over-provisioned” workload (about 10 minutes, plus checking the next day)

Cost: the add-on itself is not billed separately; the agent uses a small amount of node resources. The cluster needs the Standard tier (already set up in module 0). Prerequisite: an EA or MCA subscription is required to see the Kubernetes view in the portal; otherwise, complete only the command steps.

Enable (command tab 1)
Deploy an over-provisioned workload
kubectl create ns batch
kubectl create deployment idle-batch -n batch --image=registry.k8s.io/pause:3.10 --replicas=3
kubectl set resources deploy/idle-batch -n batch --requests=cpu=1,memory=1Gi
kubectl label ns batch costcenter=cc-2002

These 3 Pods request 3 vCPU but barely use any CPU. In the cost view, the batch namespace will show a noticeable cost.

Check the next day: portal → subscription → Cost Management → Cost analysis → select “Kubernetes clusters” as the view → select aks-lab-ops → Namespaces / Assets. Record the cost share of myapp, batch, Idle and System.
Optimize and compare
kubectl set resources deploy/idle-batch -n batch --requests=cpu=50m,memory=64Mi
# or delete it outright
kubectl delete ns batch

Cleanup: az aks update -g $RG -n $OPS --disable-cost-analysis (or just delete the cluster when the course ends).

Case 1: chargeback for a shared cluster

Problem: 12 teams share one cluster, and all costs are charged to the platform team. Approach: enable cost analysis, give each team its own namespace plus a costcenter label; export Cost Management data each month for showback, and split Idle and System costs across teams by their share. Limitations: only available for EA/MCA; for workloads that span clusters, align by namespace name.

Case 2: idle share at 45%

Problem: 3 extra nodes were kept running long-term to leave room for upgrade surge. Approach: enable the Cluster Autoscaler (surge nodes are created temporarily during upgrades and don't need permanent headroom); lower requests by 40% based on VPA recommendations; buy a 1-year savings plan for the baseline capacity. Result: idle dropped to about 15%. Limitations: scale-out takes minutes, so keep moderate headroom for latency-sensitive services.

Case 3: overnight shutdown of dev clusters

Problem: 10 dev clusters run 24×7. Approach: use Azure Automation or a scheduled pipeline to run az aks stop at 8 PM and az aks start at 8 AM (module 7). Limitations: start may fail in regions with tight capacity; disks and IPs are still billed while stopped; clusters using NAP cannot be stopped.

Common errors and fixes

Enable fails: cost analysis is not supported on Free tier clusters (illustrative)

Cause: the cluster is on the Free tier.

az aks update -g $RG -n $OPS --tier standard --enable-cost-analysis
cost-agent Pod OOMKilled or Pending

Cause: container count near the limit (about 7,000, with a 4 GB memory limit), or not enough node resources to schedule it.

kubectl get pods -n kube-system | grep -i cost
kubectl describe pod -n kube-system COST_AGENT_POD | sed -n '/Events/,$p'
kubectl get pods -A --no-headers | wc -l

Fix: see the official AKS cost analysis add-on issues; for very large clusters, split them or reduce the container count.

No “Kubernetes clusters” view in the portal's Cost analysis

Cause: the subscription is not EA/MCA; cost analysis was enabled less than 24 hours ago; or the viewer lacks permission.

Fix: confirm the subscription type (Cost Management → Properties); grant the Cost Management Reader role; wait one day.

az login --identity on a node suddenly uses the wrong identity

Cause: after enabling, the node pool has an extra cost-analysis-identity, so IMDS no longer has a single default identity.

az login --identity --resource-id <managed identity resource ID>
Command-line tasks
1. Upgrade a Free tier cluster to Standard and enable cost analysis at the same time.
az aks update -g $RG -n $OPS --tier standard --enable-cost-analysis
2. List the unattached disks in the node resource group.
az disk list -g $(az aks show -g $RG -n $OPS --query nodeResourceGroup -o tsv) --query "[?diskState=='Unattached'].name" -o tsv
Scenario analysis
The cost view shows idle cost at 50%, yet the nodes' actual CPU usage is only 20%, and the scheduler is already reporting Insufficient cpu. Is that contradictory? How would you handle it?

Not contradictory: scheduling only looks at requests. Heavily reserved but unused requests usually show up as higher namespace costs in the cost model (allocated by requests), while capacity that no request claims is what counts as Idle. High Idle together with Insufficient cpu usually comes from resource fragmentation (each node has a little left over but none can fit a large Pod), DaemonSets or system reservations, or Pod affinity constraints. To handle it: right-size requests (using VPA recommendations), choose an appropriate VM size, enable scale-down in the Cluster Autoscaler, check topology constraints, and use NAP for bin-packing where needed.

Verified teaching videos

▶
What Makes up AKS Costs? - AKS Cost Management Series - Azure Kubernetes Service — Azure Kubernetes Service (AKS)
English · AKS official channel, “Cost management series”
▶
Easy chargeback with AKS Cost Analysis — Houssem Dellai
English · Cost analysis add-on demo
▶
Understand Your AKS Spending with the Cost Analysis Add-on — Programming with Wolfgang
English · Add-on enablement and reading the view

Official documentation

Video storyboard (about 75 seconds)

This lesson cannot directly generate a video or MP3, so a storyboard and narration script are provided instead.

Shot 1 · 0–20s
On screen: an Azure bill with only three lines: VMs, disks, IPs.
Narration: The Azure bill only knows about virtual machines and disks. It doesn't know about namespaces.
Shot 2 · 20–45s
On screen: a node is sliced into colored bars: system reserved, myapp, batch, idle.
Narration: The cost analysis add-on is based on OpenCost. It splits node costs by workload, and whatever is left unused is idle cost.
Shot 3 · 45–75s
On screen: the idle bar gets shorter as autoscaling runs, and the cost figure drops.
Narration: Right-sizing requests, enabling autoscaling, and stopping clusters you don't use are the three most direct ways to save money.
or score ≥ 70% on the quiz

Module 7 · Stop/Start, Certificate Rotation and Routine Maintenance

42:00 – 50:00 · Know what the cost-saving button and the “30-minute downtime” button actually do behind the scenes
8 mincluster / nodepool stop-start GArotate-certs: up to about 30 minutes of downtime★★★★☆
Learning objectives
  • Explain what az aks stop does (drains all nodes, releases the control plane and nodes, saves state) and its limitations (VMSS only, NAP not supported, state kept for at most 12 months, standalone Pods are lost, the API server IP may change, wait 15–30 minutes before starting, capacity risk).
  • Distinguish between cluster-level stop and node pool-level az aks nodepool stop (the system pool cannot be stopped).
  • List the certificates in AKS (cluster CA, API server, kubelet client and server, service account tokens, kubectl client), and know which ones rotate automatically, which need az aks rotate-certs, and what the impact of that is.
  • Set up a routine check: cluster status, version support, certificates, quotas, node health, events, cost and alerts.
Prerequisites: TLS and certificate chain basics; drain and PDBs from module 2. Importance: ★★★★☆

What: cluster stop/start

az aks stop drains all nodes, then stops and deallocates the node VMs, and releases the control plane, which eliminates all compute cost. The cluster objects (everything in etcd except standalone Pods) are saved, and az aks start restores them from etcd.

Limitations / behaviorDetails
ScopeOnly clusters with VMSS node pools; clusters using NAP cannot be stopped
RetentionState is kept for at most 12 months; after that, it cannot be restored
While stoppedOnly start or delete are allowed; scaling and upgrades require starting first
Standalone PodsPods not managed by a controller are deleted (this lesson's prober)
After startingThe API server IP may change; the Cluster Autoscaler's node count may temporarily fall outside min/max; private clusters recreate the API server private endpoint (placed in the subnet of the first node pool)
TimingWait 15–30 minutes after stopping before starting; stop takes longer when PDBs are present (drain)
WebhookValidating/Mutating webhooks that act on cluster-scoped resources (nodes, leases, clusterroles, or wildcard rules) can cause stop to be rejected (ValidationError)
Capacity riskReleased capacity may not be obtainable again in constrained regions, so not recommended for critical production clusters
Still billedOS/data disks, public IPs, Log Analytics, ACR, etc. (see pricing for details)
Auto-upgradeStopped node pools are still “upgraded” during auto-upgrade, and the changes are applied at start; if the cluster is Stopped when the maintenance window begins, maintenance cannot run

Node pool level: az aks nodepool stop/start stops all VMs in a user pool (the system pool cannot be stopped; Spot pools are supported; the pool's Cluster Autoscaler also stops while the pool is stopped; stopped pools can be upgraded; NAP clusters are not supported). Good for turning off a GPU pool overnight.

What: certificates in AKS

CertificatesIssuerRotation method
Cluster CAAKS generates it for each cluster; clusters created after May 2019 have a 30-year validity period (2 years before that)Manual: az aks rotate-certs
API server certificateCluster CARefreshed automatically when the CA rotates
Service account tokenProjected token; kubelet renews it automaticallyRefreshed when the CA rotates
Kubelet client certificateCluster CA (TLS bootstrapping; 1.32+ uses AKS secure TLS bootstrapping, which depends on the node's Entra identity)Automatic rotation by default (clusters created after 2022-03 with Kubernetes RBAC enabled)
Kubelet serving certificateSigned by the cluster CA when KSCR (kubelet serving certificate rotation) is enabled; otherwise self-signed by the nodeKSCR: enabled by default for new pools in 1.27+; nodes are labeled kubernetes.azure.com/kubelet-serving-ca=cluster
kubectl client certificate (local accounts)Cluster CAAfter a CA rotation, run az aks get-credentials --overwrite-existing again

Two upcoming changes: starting 2027-04-01, AKS will no longer honor the node pool label aks-disable-kubelet-serving-certificate-rotation=true that is used to disable KSCR; starting 2026-11-30, issuing kubelet client certificates requires a dedicated Azure RBAC DataAction (this affects external nodes that use custom roles; AKS-managed nodes are expected to be unaffected).

How: what az aks rotate-certs does

  • Generates a new cluster CA and refreshes the SA token, API server certificate, kubelet client certificates, and (when KSCR is enabled) kubelet serving certificates.
  • Rebuilds all nodes, VMSSs and disks, which can cause up to about 30 minutes of downtime.
  • Old kubeconfigs stop working immediately: x509: certificate signed by unknown authority; you must re-fetch credentials. External services that run against the cluster and cache the CA (such as kubeconfigs in CI, or external monitoring) must also be updated.
  • If it fails, az aks show shows the status as Certificate Rotating / Failed; you can run it again.

When: when a manual CA rotation is needed

  • Suspected leak of the CA private key or of the cluster admin kubeconfig (the local-account clusterAdmin certificate). Enabling --disable-local-accounts reduces this risk at the root (hour 3).
  • A compliance policy requires periodic rotation (for example, yearly).
  • Older clusters created before May 2019 (their CA expires after two years).

Routine maintenance checklist (weekly / monthly)

FrequencyCheckCommand / location
Daily (alerts)Nodes NotReady, Pod restarts, PDB disruptionsAllowed=0 persisting, API 5xxManaged Prometheus recommended alert rules
WeeklyCluster provisioningState/powerState, last week's upgrade records, Quarantined nodes, orphaned resourcesaz aks show, activity log, kubectl get nodes -L kubernetes.azure.com/upgrade-status
MonthlyVersion support status and the next minor upgrade plan, Azure Advisor recommendations, quotas, cost (idle ratio)az aks get-upgrades, Advisor, Cost analysis
QuarterlyCertificates and credentials (service principal secrets, Key Vault certificates), disaster recovery drills, runbook updatesModule 8 review
Common misconceptions ① “stop only stops the nodes.” The control plane is released too. ② “The cluster CA rotates automatically every year.” The cluster CA must be rotated manually; what rotates automatically is the kubelet certificates. ③ “rotate-certs is seamless.” It rebuilds all nodes, with up to about 30 minutes of downtime. ④ “Users who sign in with Entra are not affected by CA rotation.” The certificate-authority-data in the kubeconfig changes too, so everyone has to re-fetch credentials.

Certificate hierarchy and rotation scope

Cluster CA (30 years)Manual: az aks rotate-certs API server certificateRefreshed with the CA SA tokenRenewed automatically by kubelet Kubelet client certificateAutomatic rotation Kubelet serving certificateKSCR automatic rotation kubectl client certificateRe-fetch after the CA rotates rotate-certs: new CA → refresh all child certificates → rebuild all nodes / VMSSs / disks (up to about 30 minutes of downtime) → users run get-credentials again
Figure 7-1: only the cluster CA needs manual rotation; the others either renew automatically or are refreshed along with the CA

Cluster stop/start state machine

Running Stoppingdrain → release VMs and control plane StoppedState retained ≤ 12 months StartingRestore etcd → start VMs az aks stopaz aks start (wait 15–30 minutes) Stopped state allows only start / delete; standalone Pods are lost; the API server IP may change
Figure 7-2: how powerState and provisioningState change

State machine simulation: stop/start and rotate-certs

After you choose an action, play it step by step and watch the state changes of the cluster, nodes, kubeconfig and workloads, along with the command output you would see.

Action:
Choose an action, then click “Next.”
$ az aks show -g rg-aks-lab -n aks-lab-ops --query "{state:provisioningState,power:powerState.code}"

Core commands

CommandPurposeDetails
az aks stop / startStop / start the whole clusterCheck powerState.code
az aks nodepool stop / start --nodepool-nameStop / start a user poolCLI ≥ 2.38.0; the system pool cannot be stopped
az aks rotate-certsRotate the cluster CA and child certificatesRebuilds all nodes; up to about 30 minutes of downtime
az aks get-credentials --overwrite-existingUpdate kubeconfigRequired after a CA rotation
az vmss run-command invokeChecks on the nodeCheck kubelet certificate expiry
az aks update (no parameters)Reconcile cluster stateCommon recovery steps for failed states

1) Cluster stop/start

az aks stop -g $RG -n $OPS
az aks show -g $RG -n $OPS --query "{state:provisioningState,power:powerState.code}" -o table
# wait at least 15–30 minutes, then:
az aks start -g $RG -n $OPS
kubectl get nodes; kubectl get pod -n myapp
State      Power
---------  -------
Succeeded  Stopped
...
NAME                    READY   STATUS    RESTARTS   AGE
myapp-6d5f7c9b8-2kq8n   1/1     Running   0          3h      ← AGE is counted from the original creation time
redis-7c4b9f8d6-q7m2x   1/1     Running   0          3h
(prober is gone: standalone Pods are deleted on stop)

2) Node pool stop/start

az aks nodepool stop -g $RG --cluster-name $OPS --nodepool-name apppool
az aks nodepool show -g $RG --cluster-name $OPS -n apppool --query "{state:provisioningState,power:powerState.code}" -o table
kubectl get pod -n myapp     # myapp can only schedule onto the user pool → Pending
az aks nodepool start -g $RG --cluster-name $OPS --nodepool-name apppool

3) Check certificate expiry

# Cluster CA (from kubeconfig)
kubectl config view --raw -o jsonpath="{.clusters[?(@.name == '$OPS')].cluster.certificate-authority-data}" | base64 -d | openssl x509 -noout -subject -enddate
# API server certificate
curl -sv https://$(az aks show -g $RG -n $OPS --query fqdn -o tsv) -k 2>&1 | grep -i "expire"
# Node kubelet client certificate
NODE_RG=$(az aks show -g $RG -n $OPS --query nodeResourceGroup -o tsv)
VMSS=$(az vmss list -g $NODE_RG --query "[?contains(name,'apppool')].name" -o tsv)
az vmss run-command invoke -g $NODE_RG -n $VMSS --instance-id 0 --command-id RunShellScript \
  --scripts "openssl x509 -in /var/lib/kubelet/pki/kubelet-client-current.pem -noout -enddate" --query "value[0].message" -o tsv
# Whether KSCR is enabled
kubectl get nodes -L kubernetes.azure.com/kubelet-serving-ca
kubectl get csr --field-selector=spec.signerName=kubernetes.io/kubelet-serving
subject=CN = ca
notAfter=Nov 14 09:40:12 2056 GMT          ← 30 years
*  expire date: Nov 14 09:51:03 2028 GMT
[stdout]
notAfter=Nov 16 10:02:44 2027 GMT
NAME                              STATUS   ...   KUBELET-SERVING-CA
aks-apppool-12345678-vmss000000   Ready    ...   cluster

The original jsonpath example uses the ?(@.name == '') placeholder; the cluster name in kubeconfig defaults to the cluster name. Confirm instance-id against the actual values from az vmss list-instances.

4) Rotate the cluster CA (causes downtime; optional in this lab)

az aks rotate-certs -g $RG -n $OPS --yes
kubectl get nodes            # old kubeconfig: x509: certificate signed by unknown authority
az aks get-credentials -g $RG -n $OPS --overwrite-existing
kubectl get nodes

Lab 7: stop/start + certificate check (about 45 minutes, including waiting)

Goal: experience the real impact of stop/start, and write a certificate expiry report for the cluster. Cost: VM and control plane costs are saved while stopped (disks and IPs are still billed). Risk: if canadacentral is short on capacity, start may need to be retried.

Record a baseline
kubectl get pod -A --no-headers | wc -l
az aks show -g $RG -n $OPS --query "{fqdn:fqdn,ip:privateFqdn}" -o table
nslookup $(az aks show -g $RG -n $OPS --query fqdn -o tsv)
Stop the cluster
time az aks stop -g $RG -n $OPS

Observe: the myapp PDB makes drain a bit slower.

Wait 15–30 minutes, then start
time az aks start -g $RG -n $OPS
nslookup $(az aks show -g $RG -n $OPS --query fqdn -o tsv)   # compare the API server IP
kubectl get pod -n myapp

Expected: myapp and redis recover (AGE is calculated from the original creation time); prober is lost, so rebuild it with the commands from module 0.

Certificate report: run the checks on command tab 3 and record the cluster CA expiry date, the API server certificate expiry date, the kubelet client certificate expiry date, and whether KSCR is enabled.
(Optional, causes downtime) run az aks rotate-certs, watch the output of prober (after it is rebuilt), and record the length of the interruption.

Cleanup: none. If you're not continuing today, you can run az aks stop again.

Case 1: the dev cluster won't come up on Monday morning

Problem: a cluster stopped on Friday failed to start on Monday with a regional capacity error (AllocationFailed). Approach: switch to a node pool-level stop (keeping the control plane and system pool running), or scale the dev cluster's user pool down to 0; don't use stop for critical dev environments. Limitations: a node pool stop saves less, because the system pool and control plane keep running.

Case 2: cluster-admin kubeconfig of a departed employee

Problem: an employee who had downloaded --admin credentials left the company. Approach: run az aks rotate-certs in a maintenance window to invalidate all certificate-based credentials, then enable --disable-local-accounts so only Entra identities can access the cluster. Limitations: about 30 minutes of downtime; the CA cached in CI systems and external monitoring must also be updated.

Case 3: metrics-server reports x509 errors

Problem: some tools connect directly to the kubelet on port 10250 and report certificate errors after KSCR is enabled, because serving certificates are now signed by the cluster CA. Approach: update the tool's certificate path or CA trust (the certificate is at /var/lib/kubelet/kubelet-server-current.pem). Limitations: starting 2027-04-01, the label that disables KSCR no longer takes effect, so fix the tools in advance.

Common errors and fixes

Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" ...)

Cause: the CA has been rotated, but the local kubeconfig still has the old CA.

az aks get-credentials -g $RG -n $OPS --overwrite-existing
az aks stop returns ValidationError (webhook related)

Cause: a Validating/Mutating webhook acts on cluster-scoped resources (nodes, leases, clusterroles) or uses wildcard rules.

kubectl get validatingwebhookconfigurations,mutatingwebhookconfigurations
kubectl get validatingwebhookconfiguration NAME -o jsonpath='{.webhooks[*].rules}'

Fix: narrow the rules (avoid *), use scope: Namespaced + namespaceSelector, or failurePolicy: Ignore, or temporarily remove the webhook before stopping.

Operation is not allowed because the managed cluster is in stopped state (illustrative)

Cause: the Stopped state only allows start / delete.

az aks show -g $RG -n $OPS --query powerState.code
az aks start -g $RG -n $OPS
rotate-certs failed partway through; cluster status Failed / Certificate Rotating
az aks show -g $RG -n $OPS --query "{state:provisioningState,power:powerState.code}"
az aks rotate-certs -g $RG -n $OPS --yes      # official guidance: run it again if it fails
nodepool stop error: cannot stop system node pool (illustrative)

Cause: the system pool cannot be stopped. Fix: stop only the user pools, or stop the whole cluster.

Command-line tasks
1. Write a script: if the cluster's powerState is Running, stop it; otherwise, start it.
P=$(az aks show -g $RG -n $OPS --query powerState.code -o tsv)
if [ "$P" = "Running" ]; then az aks stop -g $RG -n $OPS --no-wait; else az aks start -g $RG -n $OPS --no-wait; fi
2. List the nodes that have KSCR enabled.
kubectl get nodes -l kubernetes.azure.com/kubelet-serving-ca=cluster
Scenario analysis
A team wants to stop a staging cluster every night to save money. The cluster uses NAP, has a private API server, and relies on standalone Pods, apart from a monitoring DaemonSet, for health probing. Evaluate the plan.

A cluster using NAP cannot be stopped. Change it to a non-NAP cluster, or use a different way to save money (NAP itself scales down idle nodes, and once user workloads scale to 0, NAP reclaims the nodes). If you move to a non-NAP cluster: a private cluster recreates the API server private endpoint at start (in the subnet of the first node pool), so DNS, the private DNS zone and jump host configuration must be able to handle that. Standalone Pods are lost on stop, so they must be changed to Deployments. After starting, wait for the nodes to be Ready and the workloads to recover before running staging's automated tests. Also watch the capacity risk and the 12-month state retention limit.

Verified teaching videos

▶
Azure AKS Stop and Start — John Savill's Technical Training
English · How cluster stop/start works and its limitations (recorded earlier; for the current limits, follow this lesson and the official docs)
▶
AKS Cluster Stop Start Demo — Kubebox
English · Command demo

Certificate rotation (az aks rotate-certs): no verified video found; see the storyboard below.

Official documentation

Video storyboard: certificate rotation (about 70 seconds)

This lesson cannot directly generate a video or MP3, so a storyboard and narration script are provided instead.

Shot 1 · 0–20s
On screen: a certificate tree, with the root “Cluster CA, 30 years” and the branches API server, kubelet, and service account tokens.
Narration: AKS's cluster certificate authority is valid for 30 years and must be rotated manually. Kubelet certificates renew automatically.
Shot 2 · 20–45s
On screen: rotate-certs runs, the whole tree changes color, and nodes rebuild one by one while a timer runs to thirty minutes.
Narration: Rotation generates a new root certificate and rebuilds all nodes, which can cause up to about thirty minutes of downtime.
Shot 3 · 45–70s
On screen: an x509 error appears in the developer's terminal, and then get-credentials restores access.
Narration: After rotation, every old kubeconfig stops working, so everyone has to re-fetch credentials.
or score ≥ 70% on the quiz

Module 8 · Operations Review

50:00 – 60:00 · Turn the first 7 modules into a checklist you can reuse every quarter, a runbook, and a troubleshooting tree
10 minWell-Architected · Operational Excellence★★★★★
Learning objectives
  • Use a scorecard to assess the Day-2 operations maturity of an AKS cluster: version, upgrade settings, PDBs, auto-upgrade and windows, observability, auditing, cost, certificates and credentials.
  • Write an upgrade runbook: prepare → pre-check → execute → observe → verify → roll back.
  • Use the interactive troubleshooting tree to locate common causes of upgrade failure: PDBs, quotas, subnets, deprecated APIs, windows, versions, and certificates.
  • Design an upgrade game day: on staging, simulate PDB blocking, insufficient quota, and rollback.
Prerequisites: modules 1–7. Importance: ★★★★★

What: what the operations review assesses

AreaWhat “good” looks likeEvidence (command / location)
VersionRunning a community-supported or LTS version; no more than N-1 behind; the next minor upgrade date is knownaz aks show, get-upgrades
Auto-upgradeCluster channel stable/patch; node OS channel NodeImage/SecurityPatch; both aksManaged* windows ≥ 4 hoursautoUpgradeProfile, maintenanceconfiguration list
Upgrade settingsUser pool maxSurge 33% (or a justified value); drainTimeout matches the longest termination; undrainable-node-behavior Cordonnodepool list --query upgradeSettings
Workload resilienceCritical services with ≥ 2–3 replicas, PDBs allowing ≥ 1 disruption, probes and preStop, topology spreadkubectl get pdb -A
CapacityQuota ≥ max surge; subnet headroom; VMSS not approaching 1000az vm list-usage
ObservabilityManaged Prometheus + alert rules; Container Insights (cost preset); upgrade events visibleModule 4
AuditingResource-specific diagnostic settings: kube-audit-admin, guard, apiserver; retention meets compliance requirementsModule 5
CostCost analysis enabled; Idle < 30%; complete tags; budget alertsModule 6
Credentials and certificates--disable-local-accounts; certificate check records; monitoring for service principal secret expiryModule 7, hour 3
ProcessUpgrade runbook, rollback plan, notifications (Event Grid / Communication Manager), drill recordsThis module

How: upgrade runbook (template)

  1. Prepare (T-7 days): read the AKS release notes and the breaking changes for the target version; staging has been running the target version for ≥ 1 week; kubent reports nothing; confirm quota and subnets.
  2. Pre-check (T-1 hour): get-upgrades; PDBs show disruptionsAllowed ≥ 1; no Quarantined nodes; alert silencing policy in place; notify the relevant teams.
  3. Execute: control-plane-only → system pool → user pools (non-critical first, critical last); use blue-green for critical pools.
  4. Observe (soak period for each pool): 5xx, P99, Pending Pods, number of Ready nodes, drain events, 429s in AKSAuditAdmin.
  5. Verify: all nodes on the new version; surge nodes deleted; prober and synthetic monitoring healthy; no cost anomalies.
  6. Roll back: rollback on the node pool within 7 days; for blue-green, uncordon the old pool; the control plane cannot be rolled back, so rely on staging validation.
  7. Review: record the duration, interruption seconds, issues, and improvement items.

Why: the value of an operations review

Most AKS upgrade incidents are not caused by defects in AKS itself, but by configuration drift: PDBs written wrong, too few replicas, quota not requested, windows too short, versions allowed to go stale. A quarterly review catches these chronic problems before the upgrade.

When: cadence

  • Before each minor upgrade: the pre-check part of the runbook.
  • Quarterly: the full scorecard.
  • Every six months: a game day (PDB blocking, insufficient quota, rollback, stop/start failure).
Common misconceptions ① “If auto-upgrade is on, you don't need a runbook.” Auto-upgrade only executes; when it fails, a person still needs to handle it using the runbook. ② “AKS Automatic doesn't need reviews.” Automatic sets the channel and guardrails for you, but PDBs, replicas, quota and cost are still your responsibility. ③ “A review is a one-time thing.” Configuration drifts, so it must be re-checked regularly.

Day-2 operations loop

PlanVersion calendar · windows · rings ExecuteChannels / runbook / Fleet ObservePrometheus · logs · audit ReviewScorecard · cost · retrospective Inputs: AKS release notes · Advisor · release tracker · platform-initiated upgrade calendar
Figure 8-1: plan → execute → observe → review, one cycle per quarter

Triage for upgrade failures

Upgrade failed Pre-check failed: version / deprecated APIs Surge failed: quota / capacity / IPs Drain failed: PDB / long termination Node not ready: image / network / extensions kubent / step-by-step upgrade / force (time-limited) Lower maxSurge / maxUnavailable / request quota / expand subnet Fix PDBs / Cordon behavior / increase drainTimeout Events + node logs → deep troubleshooting in hour 7
Figure 8-2: four types of upgrade failure and the preferred response (interactive version on the “Troubleshooting” tab)

Interactive scorecard: your cluster's Day-2 operations maturity

Check the items your cluster already meets (you can start by checking based on aks-lab-ops's current state). The scorecard calculates the score for each area in real time and gives the top 3 improvement items with their matching commands. Checkbox state is kept only on the current page and is not written to storage.

Review script: collect all the evidence in one run

#!/usr/bin/env bash
# Usage: RG=rg-aks-lab CL=aks-lab-ops ./ops-review.sh
set -euo pipefail
echo "== Version and support"
az aks show -g $RG -n $CL --query "{ver:currentKubernetesVersion,tier:sku.tier,plan:supportPlan,state:provisioningState,power:powerState.code}" -o table
az aks get-upgrades -g $RG -n $CL -o table
echo "== Auto-upgrade and windows"
az aks show -g $RG -n $CL --query autoUpgradeProfile -o table
az aks maintenanceconfiguration list -g $RG --cluster-name $CL --query "[].{name:name,dur:maintenanceWindow.durationHours,start:maintenanceWindow.startTime,utc:maintenanceWindow.utcOffset}" -o table
echo "== Node pool upgrade settings"
az aks nodepool list -g $RG --cluster-name $CL --query "[].{pool:name,mode:mode,ver:currentOrchestratorVersion,img:nodeImageVersion,surge:upgradeSettings.maxSurge,unavail:upgradeSettings.maxUnavailable,drain:upgradeSettings.drainTimeoutInMinutes,soak:upgradeSettings.nodeSoakDurationInMinutes,undrain:upgradeSettings.undrainableNodeBehavior}" -o table
echo "== PDB (disruptionsAllowed=0 is an upgrade-blocking risk)"
kubectl get pdb -A -o custom-columns=NS:.metadata.namespace,NAME:.metadata.name,ALLOWED:.status.disruptionsAllowed,HEALTHY:.status.currentHealthy | awk 'NR==1 || $3=="0"'
echo "== Quarantined nodes"
kubectl get nodes -l kubernetes.azure.com/upgrade-status=Quarantined
echo "== Monitoring, audit, cost"
az aks show -g $RG -n $CL --query "{prom:azureMonitorProfile.metrics.enabled,ci:addonProfiles.omsagent.enabled,cost:metricsProfile.costAnalysis.enabled,localAccounts:disableLocalAccounts}" -o table
az monitor diagnostic-settings list --resource $(az aks show -g $RG -n $CL --query id -o tsv) --query "[].{name:name,mode:logAnalyticsDestinationType}" -o table
echo "== Quota (example: DSv5 family)"
az vm list-usage -l $(az aks show -g $RG -n $CL --query location -o tsv) --query "[?contains(name.value,'standardDSv5Family')].{name:name.localizedValue,used:currentValue,limit:limit}" -o table
== Node pool upgrade settings
Pool        Mode    Ver     Img                                        Surge  Unavail  Drain  Soak  Undrain
----------  ------  ------  -----------------------------------------  -----  -------  -----  ----  -------
systempool  System  1.36.5  AKSUbuntu-2204gen2containerd-202611.03.0   33%    0        30     0
apppool     User    1.36.5  AKSUbuntu-2204gen2containerd-202611.03.0   1      0        15     2     Cordon
== PDB (disruptionsAllowed=0 is an upgrade-blocking risk)
NS     NAME   ALLOWED   HEALTHY

The JMESPath field names (such as upgradeSettings.undrainableNodeBehavior, nodeSoakDurationInMinutes, addonProfiles.omsagent) should be confirmed against the actual output of az aks nodepool show -o json / az aks show -o json; if a field doesn't exist, it shows as empty.

Upgrade notifications

# Subscribe to AKS Event Grid events (such as a new version becoming available, or node pool upgrades starting or finishing), delivered to a webhook / Service Bus
AKS_ID=$(az aks show -g $RG -n $OPS --query id -o tsv)
az eventgrid event-subscription create --name aks-upgrade-events --source-resource-id $AKS_ID \
  --endpoint https://example.invalid/hooks/aks --included-event-types \
  Microsoft.ContainerService.NewKubernetesVersionAvailable \
  Microsoft.ContainerService.ClusterSupportEnding Microsoft.ContainerService.ClusterSupportEnded \
  Microsoft.ContainerService.NodePoolRollingStarted Microsoft.ContainerService.NodePoolRollingSucceeded Microsoft.ContainerService.NodePoolRollingFailed

The six event types above were verified against the Azure Event Grid AKS event schema (ClusterSupportEnding can serve as an early warning that a version is about to expire); example.invalid is a placeholder address.

Lab 8: run an operations review and an upgrade game day on aks-lab-ops (about 20 minutes)

Run the review script (command tab) and save the output as review-$(date +%F).txt.
Game day 1: PDB blocking
kubectl patch pdb myapp-pdb -n myapp --type merge -p '{"spec":{"maxUnavailable":0}}'
kubectl get pdb -n myapp       # ALLOWED DISRUPTIONS = 0
az aks nodepool upgrade -g $RG --cluster-name $OPS -n apppool --node-image-only --no-wait
kubectl get nodes -L kubernetes.azure.com/upgrade-status -w

Expected: because of undrainable-node-behavior Cordon, the first node's drain times out (after 15 minutes) and is marked Quarantined; the upgrade continues, or stops once max-blocked-nodes is reached. If the cluster is already on the latest image, this command won't trigger an upgrade. In that case, you can instead observe a manual kubectl drain to demonstrate the 429.

Recover
kubectl patch pdb myapp-pdb -n myapp --type merge -p '{"spec":{"maxUnavailable":1}}'
kubectl label nodes -l kubernetes.azure.com/upgrade-status=Quarantined kubernetes.azure.com/upgrade-status-
az aks update -g $RG -n $OPS          # reconcile state
Write the review conclusions: score the cluster using the scorecard on the “animation” tab, and list 3 improvement items with owners and due dates.
Course cleanup (if you're not doing the capstone lab)
az aks delete -g $RG -n $OPS --yes --no-wait
az monitor account delete -g $RG -n amw-aks-lab --yes
az monitor log-analytics workspace delete -g $RG -n law-aks-lab --yes --force

Case 1: three “time bombs” found in the quarterly review

Findings: ① one cluster is still on N-3, and the platform-initiated upgrade month is 6 weeks away; ② 3 namespaces have PDBs with disruptionsAllowed=0; ③ the subscription's vCPU quota only covers a surge of 2 nodes. Actions: complete the minor upgrade within two weeks; fix the PDBs; request more quota. Result: avoided an uncontrolled platform upgrade.

Case 2: upgrade notifications routed to the on-call system

Approach: the NodePoolRollingFailed event from Event Grid → Logic App → PagerDuty; NewKubernetesVersionAvailable → the ticketing system automatically creates an “evaluate new version” task. Limitations: events only tell you what happened; the root cause still requires checking events and audit logs.

Case 3: AKS Automatic also needs reviews

Problem: the team assumed an Automatic cluster was “fully automatic,” but one service with only 1 replica and a strict PDB blocked the automatic upgrade. Approach: the “workload resilience” item in the scorecard applies here too; the Deployment Safeguards preset by Automatic can warn you, but they cannot replace good design.

Interactive troubleshooting tree: AKS upgrade and operations failures

Step through the symptoms you observe to reach diagnostic commands and fix suggestions.

Supplement: frequent errors

Upgrade did not start in maintenance window and cluster is now out of support

Check whether the channel is none, whether the window is ≥ 4 hours, and whether the cluster is Stopped. Once the version expires, auto-upgrade no longer takes effect, and you need to upgrade manually in full.

OperationNotAllowed: Another operation (Upgrading) is in progress
az aks show -g $RG -n $OPS --query provisioningState
az aks operation-abort -g $RG -n $OPS        # abort cluster-level operations if necessary
az aks nodepool operation-abort -g $RG --cluster-name $OPS -n apppool
Command-line tasks
1. Find all PDBs with disruptionsAllowed at 0 using one command.
kubectl get pdb -A -o jsonpath='{range .items[?(@.status.disruptionsAllowed==0)]}{.metadata.namespace}/{.metadata.name}{"\n"}{end}'
2. List all ARM write operations run against aks-lab-ops in the past 7 days, along with their callers.
az monitor activity-log list -g $RG --offset 7d --query "[?contains(resourceId,'aks-lab-ops') && contains(operationName.value,'write')].{t:eventTimestamp,op:operationName.value,who:caller,st:status.value}" -o table
Scenario analysis
You've taken over 15 AKS clusters with no documentation at all. What do you do in the first week?

① Inventory: use the review script to collect each cluster's version, tier, channel, windows, node pool settings, diagnostic settings, and cost analysis status; compare against the calendar to mark clusters at N-3 or about to expire, and the platform-initiated upgrade months. ② Stop the bleeding: enable diagnostic settings (kube-audit-admin) and basic managed Prometheus alerts on all clusters, fix PDBs with disruptionsAllowed=0, and schedule upgrades for clusters at risk of expiry. ③ Set a rhythm: set channels and windows per environment (staggered windows to avoid ARM throttling), and introduce Fleet to manage phased upgrades. ④ Write the runbook and run a game day on staging.

Verified teaching videos

▶
Diagnose & Solve with Andrew Scobie: AKS Troubleshooting Series: Azure Kubernetes Service — Azure Kubernetes Service (AKS)
English · AKS official channel, using the portal's “Diagnose and solve problems” tool
▶
Azure Kubernetes Services (AKS) Overview — John Savill's Technical Training
English · Overall review, useful for revisiting the architecture before the review

Official documentation

Video storyboard (about 70 seconds)

This lesson cannot directly generate a video or MP3, so a storyboard and narration script are provided instead.

Shot 1 · 0–20s
On screen: a ring diagram: plan, execute, observe, review.
Narration: Day-2 operations is a loop. Plan the versions and windows, execute the upgrade, observe metrics and logs, then review on a regular basis.
Shot 2 · 20–45s
On screen: red items on the scorecard: PDB allowed disruptions at zero, insufficient quota, version N-3.
Narration: A review looks for configuration drift: PDBs written wrong, quota that isn't enough, versions about to expire.
Shot 3 · 45–70s
On screen: runbook cards flip through: pre-check, execute, observe, verify, roll back.
Narration: Write these steps into the upgrade playbook and rehearse them in a test environment, so the real upgrade goes smoothly.
or score ≥ 70% on the quiz

Command cheat sheet

Upgrades · auto-upgrade and windows · monitoring · diagnostics · cost · stop/start · certificates
Printable

Version and support

az aks get-versions -l $LOC -o table
az aks get-upgrades -g $RG -n $CL -o table
az aks show -g $RG -n $CL --query "{v:currentKubernetesVersion,tier:sku.tier,plan:supportPlan}"
# LTS (Premium)
az aks update -g $RG -n $CL --tier premium \
  --k8s-support-plan AKSLongTermSupport --auto-upgrade-channel patch
kubent --target-version 1.36.0

Step-by-step upgrade

az aks upgrade -g $RG -n $CL --kubernetes-version 1.36.5 --control-plane-only --yes
az aks nodepool upgrade -g $RG --cluster-name $CL -n systempool --kubernetes-version 1.36.5
az aks nodepool upgrade -g $RG --cluster-name $CL -n apppool --kubernetes-version 1.36.5 --no-wait
kubectl get events -A --field-selector reason=Drain
kubectl get events -A --field-selector reason=Surge

Upgrade settings

az aks nodepool update -g $RG --cluster-name $CL -n apppool \
  --max-surge 33% --drain-timeout 30 --node-soak-duration 2 \
  --undrainable-node-behavior Cordon --max-blocked-nodes 1
# in place (insufficient quota; not for the system pool)
az aks nodepool upgrade ... --max-surge 0 --max-unavailable 1
# last resort (bypasses deprecated APIs and PDBs)
az aks upgrade ... --enable-force-upgrade --upgrade-override-until 2026-11-20T13:00:00Z

Rollback and blue-green

az aks nodepool get-rollback-versions -g $RG --cluster-name $CL -n apppool
az aks nodepool rollback -g $RG --cluster-name $CL -n apppool
az aks nodepool operation-abort -g $RG --cluster-name $CL -n apppool
# blue-green
az aks nodepool add ... -n appgreen --kubernetes-version 1.36.5
kubectl cordon -l agentpool=apppool
kubectl drain NODE --ignore-daemonsets --delete-emptydir-data

Node image, channel, windows

az aks nodepool get-upgrades -g $RG --cluster-name $CL --nodepool-name apppool
az aks nodepool upgrade -g $RG --cluster-name $CL -n apppool --node-image-only
az aks update -g $RG -n $CL --auto-upgrade-channel stable --node-os-upgrade-channel NodeImage
az aks maintenanceconfiguration add -g $RG --cluster-name $CL \
  --name aksManagedNodeOSUpgradeSchedule --schedule-type Weekly \
  --day-of-week Sunday --interval-weeks 1 --duration 4 --utc-offset -05:00 --start-time 02:00
az aks maintenanceconfiguration list -g $RG --cluster-name $CL -o table

Monitoring

az aks update -g $RG -n $CL --enable-azure-monitor-metrics \
  --azure-monitor-workspace-resource-id $AMW_ID --enable-control-plane-metrics
az aks enable-addons -g $RG -n $CL --addon monitoring \
  --workspace-resource-id $LAW_ID --data-collection-settings dcs.json
kubectl get ds ama-logs ama-metrics-node -n kube-system
kubectl get deploy ama-logs-rs -n kube-system

Diagnostic settings and audit

az monitor diagnostic-settings categories list --resource $AKS_ID -o table
az monitor diagnostic-settings create --name aks-diag --resource $AKS_ID \
  --workspace $LAW_ID --export-to-resource-specific true \
  --logs '[{"category":"kube-audit-admin","enabled":true},{"category":"kube-apiserver","enabled":true}]'
az monitor log-analytics workspace table update -g $RG \
  --workspace-name law-aks-lab --name AKSAudit --plan Basic

Cost, stop/start, certificates

az aks update -g $RG -n $CL --enable-cost-analysis      # Standard/Premium
az aks stop -g $RG -n $CL ; az aks start -g $RG -n $CL
az aks nodepool stop -g $RG --cluster-name $CL --nodepool-name apppool
az aks rotate-certs -g $RG -n $CL --yes                # up to about 30 minutes of downtime
az aks get-credentials -g $RG -n $CL --overwrite-existing
kubectl get nodes -L kubernetes.azure.com/kubelet-serving-ca

Quick troubleshooting table

SymptomMost likely causeFirst commandModule
Cannot evict pod as it would violate the pod's disruption budgetPDB does not allow disruptionkubectl get pdb -AM2
UpgradeBlockedOnDeprecatedAPIUsageRemoved API used within the last 12 hourskubentM1
NotAllAgentPoolOrchestratorVersionSpecifiedAndUnchangedcontrol-plane-only performed while auto-upgrade is enabledaz aks show --query autoUpgradeProfileM2/M3
SubnetIsFull / AllocationFailedInsufficient IPs or capacity for surgeaz vm list-usageM2
Auto-upgrade did not happenChannel none / window < 4h / cluster Stopped / expiredmaintenanceconfiguration listM3
No data in AKSAuditAdminNo diagnostic settings, or AzureDiagnostics mode is useddiagnostic-settings listM5
Kubernetes not visible in the cost viewFree tier / not EA·MCA / less than 24haz aks show --query sku.tierM6
x509: certificate signed by unknown authorityCA has been rotatedaz aks get-credentials --overwrite-existingM7

Recommended configuration snippet (production user pool)

resource "azurerm_kubernetes_cluster_node_pool" "app" {
  name                  = "apppool"
  kubernetes_cluster_id = azurerm_kubernetes_cluster.aks.id
  vm_size               = "Standard_D4s_v5"
  mode                  = "User"
  upgrade_settings {
    max_surge                     = "33%"
    drain_timeout_in_minutes      = 30
    node_soak_duration_in_minutes = 2
  }
}
# Cluster: automatic_upgrade_channel = "stable", node_os_upgrade_channel = "NodeImage"
# Maintenance windows: maintenance_window_auto_upgrade / maintenance_window_node_os blocks
# (confirm parameter names against the azurerm provider docs; newer parameters such as the undrainable behavior can be set with azapi)

Capstone lab: an auditable, rollback-ready production candidate upgrade

Tie together everything in this lesson: assess → observe → configure → upgrade → audit → cost → wrap up
About 60–90 minIncurs cost
Scenario

The platform team needs to deliver aks-lab-ops as a “production candidate” cluster. Requirements: keep the version at N-1 and follow automatically; node images update automatically every week, but only on Sunday early morning; during upgrades, myapp's interruption must be < 5 seconds (Redis's interruption must be reported separately); all changes must be auditable; cost must be visible per namespace; the handover includes an operations review report.

Assess: run the review script from module 8, and record the current version, channel, windows and upgrade settings.
RG=rg-aks-lab CL=aks-lab-ops bash ops-review.sh | tee review-before.txt
Observability and audit first: confirm that managed Prometheus, Container Insights (Logs and Events preset), and diagnostic settings (kube-audit-admin, kube-apiserver, guard) are all enabled (modules 4 and 5).
Harden the workload: keep myapp at 4 replicas with PDB maxUnavailable 1; add a preStop to myapp to reduce 5xx during rolling updates.
kubectl patch deploy myapp -n myapp --type json -p '[{"op":"add","path":"/spec/template/spec/containers/0/lifecycle","value":{"preStop":{"sleep":{"seconds":5}}}}]'
Upgrade settings: apppool --max-surge 33% --drain-timeout 15 --node-soak-duration 2 --undrainable-node-behavior Cordon --max-blocked-nodes 1; systempool --max-surge 33%.
Run one controlled upgrade: if the cluster is already on 1.36, run a node image upgrade (or repeat module 2 on a newly created 1.35 cluster). Run prober at the same time and record the seconds of non-200 responses.
az aks nodepool upgrade -g $RG --cluster-name $OPS -n apppool --node-image-only --no-wait
kubectl logs -n myapp prober -f | grep -v " 200$"
Audit evidence: use KQL to export the Drain events during this upgrade (KubeEvents), the evictions rejected by PDBs (429s in AKSAuditAdmin), and the callers from the activity log.
Automation: set stable + NodeImage, and create two maintenance windows (cluster: the first Sunday of each month, 6 hours; node OS: every Sunday, 4 hours, with year-end notAllowedDates).
Cost and wrap-up: enable cost analysis and tag namespaces and node pools with costcenter; run the review script again to generate review-after.txt; score it with the scorecard. Finally, run az aks stop or delete the cluster as needed.

Acceptance checklist

Open-ended self-check (6 questions)

1. Why is “control-plane-only first, then pool by pool” recommended, while it can't be done once auto-upgrade is enabled? How can you have both?

A staged upgrade lets you validate API compatibility first (the control plane cannot be rolled back), then observe each pool and keep the 7-day node pool rollback option. Auto-upgrade upgrades the control plane and all pools together. To have both: keep prod on the patch channel and orchestrate minor upgrades manually through the pipeline (staged), or run the stable channel on staging for a week first, then roll out to prod in phases with Fleet.

2. What are the effects of maxSurge=33% and maxUnavailable=1 on capacity, speed and interruption?

maxSurge adds temporary capacity (it requires quota and IPs), and the number of nodes drained at once equals the surge count, which speeds things up. maxUnavailable adds no capacity; it directly reduces available nodes, which suits cases with limited quota but leaves the remaining nodes more crowded and makes PDB blocking more likely. The rollback strategy when both are > 0 is currently in Preview.

3. What is the essential difference between a platform-initiated upgrade and the auto-upgrade channel? How do you avoid the former?

Auto-upgrade respects the channel and maintenance windows, and is subject to deprecated API checks and PDB constraints. Platform-initiated upgrades target clusters that have expired plus a 60-day grace period; they ignore windows, skip deprecated API checks, can override PDBs, and cannot be rolled back. To avoid them: always stay on a community-supported or LTS version, use the stable or patch channel with windows, and subscribe to the ClusterSupportEnding event.

4. NodeImage or SecurityPatch?

NodeImage: a new VHD every week, includes bug fixes, reimages on each update, no extra VHD cost, supports Windows. SecurityPatch: faster pure security patches, applied in place for most workloads and reimaged only when necessary, has extra VHD cost, does not support Windows, and conflicts with CMK deny policies. Choose SecurityPatch for speed and less interruption; choose NodeImage for complete fixes and simplicity.

5. Why is the kube-audit-admin + resource-specific mode recommended?

kube-audit-admin excludes get/list and keeps all change events, which greatly reduces data volume and cost. Resource-specific mode writes to structured tables such as AKSAuditAdmin, which makes queries simple and supports Basic logs.

6. When should you not use az aks stop?

Business-critical clusters (capacity may not be obtainable again after release), clusters using NAP (not supported), environments that depend on standalone Pods or a fixed API server IP, periods when maintenance or upgrades must run during downtime, and clusters that might go unstarted for more than 12 months.

Sources and versions

Sources for all version and behavior facts in this lesson (Verified on 2026-11-15/16)
TopicVerified conclusionSource (page update date)
Version calendar and support policyCommunity support 1.35/1.36/1.37 (N-2); 1.34 community support ends 2026-11; 1.38 preview planned for 2026-11, GA 2027-02; platform support N-3 + 60-day grace period; platform-initiated upgrades from 2027-06-01; default N-1; patches for at least 2 months; non-LTS clusters cannot skip minor versions; control plane can lead node pools by up to 3 minor versionsSupported Kubernetes versions (ms.date 2026-09-15, updated 2026-10-21); Upgrade control plane (2026-07-30)
LTSRequires Premium tier + --k8s-support-plan AKSLongTermSupport; 1 year community + 1 year LTS; latest two patches only; Calico not supportedLong-term support (2026-08-05, updated 2026-11-07)
AKS release notesRelease 2026-10-25: 1.37 reaches GA and becomes LTS; 1.36 becomes the default for new clusters; patches 1.37.1 / 1.36.5 / 1.35.9 / 1.34.12; node pool rollback GA (released 2026-08-07); blue-green pool Preview; LocalDNS default in 1.37+; Windows Server 2022 not supported in 1.37+github.com/Azure/AKS/releases (accessed 2026-11-16)
Rolling upgrade parametersSurge process has 6 steps; maxSurge recommended at 33% (one doc gives the default as 1 node; another says max-blocked-nodes defaults to maxSurge, “usually 10%”); 1.35+ falls back to surge 1; maxUnavailable defaults to 0 and is not available for the system pool; drain defaults to 30 minutes (5–1440); soak 0–30; VMSS limit of 1000Configure rolling upgrades (2026-05-29, updated 2026-09-16)
Undrainable nodes, forced upgrades, preflight checksSchedule (default) / Cordon + kubernetes.azure.com/upgrade-status=Quarantined; --max-blocked-nodes; force upgrade requires CLI 2.79+ / API 2025-09-01+, default 3 days; IP formulaUpgrade options (2026-06-22, updated 2026-10-10)
Deprecated APIs block upgradessubcode UpgradeBlockedOnDeprecatedAPIUsage; 12-hour detection window; target ≥ 1.26; not applicable to platform-initiated upgradesStop upgrades on API breaking changes (2026-07-01)
Node pool rollbackCLI 2.88.0+, API 2026-04-01+, no aks-preview needed; 7 days; rolls back to the previous version only; auto-upgrade channel must be turned off; OS SKU changes are not rolled backRoll back node pool versions (2026-08-05, updated 2026-10-10)
Node imagesLinux weekly, Windows monthly; up to about two weeks to cover all regions; cannot downgrade; Azure Linux 2.0 images removed 2026-10-31Upgrade node images (2026-08-03)
Auto-upgrade channelsnone/patch/stable/rapid/node-image (legacy); takes effect within 24 hours; cannot be control-plane-only once enabledAuto-upgrade cluster (2026-06-26, updated 2026-10-22)
Node OS channelsNone/Unmanaged/SecurityPatch/NodeImage; from API 2023-06-01, new Standard clusters default to NodeImage; SecurityPatch limits (Windows, CMK deny policy, CLI 2.61+)Autoupgrade node OS images (2026-06-26, updated 2026-09-12)
Maintenance configurationdefault / aksManagedAutoUpgradeSchedule / aksManagedNodeOSUpgradeSchedule; ≥ 4 hours; start 15 minutes ahead; best effort; shared window Preview (CLI 2.85+); CLI parameters (--week-index, etc.)Planned Maintenance (2026-08-10, updated 2026-10-20); CLI reference (2026-09)
Enabling monitoring--enable-azure-monitor-metrics, --enable-control-plane-metrics, enable-addons --addon monitoring --data-collection-settings; cost presets; agent namesEnable monitoring for AKS (2026-08-18, updated 2026-11-10)
Control plane logsCategory list, kube-audit cost recommendations, resource-specific mode with AKSAudit/AKSAuditAdmin/AKSControlPlane, CLI examples; AKSAuditAdmin column definitionsMonitor AKS (2026-08-18); AKSAuditAdmin (2026-07-27)
Cost analysisStandard/Premium; EA/MCA; OpenCost; about 7,000 containers; 8–24 hours; cost-analysis-identityAKS cost analysis (2026-07-29)
Stop/startVMSS only, not NAP, 12 months, standalone Pod deletion, IPs may change, wait 15–30 minutes, webhook ValidationError; node pool stop cannot stop the system poolStop/start cluster (2026-07-21); Stop/start node pools (2026-08-12)
CertificatesCA lifetime 30 years (clusters created after 2019-05); rotate-certs rebuilds nodes, with up to about 30 minutes of downtime; KSCR 1.27+; from 2027-04-01 disabled labels are no longer recognized; from 2026-11-30 kubelet client certificates need a new DataActionCertificate rotation overview (2026-10-13); Rotate certificates (2026-07-13)
Event Grid eventsNewKubernetesVersionAvailable, ClusterSupportEnding/Ended, NodePoolRollingStarted/Succeeded/FailedAKS as Event Grid source (updated 2026-02-25)

Video verification notes

All videos were checked on 2026-11-16 via YouTube oEmbed (https://www.youtube.com/oembed?url=…&format=json) to confirm that titles and channels match:

ModuleVideo (title — channel)
M1/M2Upgrading and Maintaining your Azure Kubernetes Service (AKS) Cluster — John Savill's Technical Training
M1AKS upgrade options — Houssem Dellai
M2AKS cluster upgrades and managed K8s — ITOpsTalk
M3AKS Node Images Upgrade — Houssem Dellai; AKS Patching and Node Pool Upgrade … explained in plain English — cloud-monk
M4AKS Labs: Observability with Managed Prometheus and Managed Grafana — Azure Kubernetes Service (AKS); Azure Managed Prometheus and Grafana for AKS monitoring — Houssem Dellai; How Prometheus Monitoring works — TechWorld with Nana
M5Understanding Key Components of AKS Monitoring — Lionel Gurret; Azure Monitor, Log Analytics, Diagnostic settings — Florian Trippel
M6What Makes up AKS Costs? - AKS Cost Management Series — Azure Kubernetes Service (AKS); Easy chargeback with AKS Cost Analysis — Houssem Dellai; Understand Your AKS Spending with the Cost Analysis Add-on — Programming with Wolfgang
M7Azure AKS Stop and Start — John Savill's Technical Training; AKS Cluster Stop Start Demo — Kubebox; Certificate rotation: no verified video found (storyboard provided instead)
M8Diagnose & Solve with Andrew Scobie: AKS Troubleshooting Series — Azure Kubernetes Service (AKS); Azure Kubernetes Services (AKS) Overview — John Savill's Technical Training

oEmbed can only verify titles and channels, not durations or publish dates. Most videos were recorded before this lesson's verification date, so for version details, follow this lesson and the official docs.

Voice narration notes

The “Voice” tab uses the browser's built-in Web Speech API (speechSynthesis, with an en-US voice reading the narration and the English terms). This lesson is a single offline file, so it cannot embed MP3s. Version numbers and dates in the narration script are written out as they should be spoken, so you can pass the script directly to any TTS tool to generate audio.

Known limitations

  • Commands were not run on a real subscription: all “expected output” blocks are examples. Version patch numbers (such as 1.35.9, 1.36.5), node image names, node names, IPs, times, and costs are illustrative values. Use az aks get-versions and your actual output as the source of truth.
  • maxSurge default: the two official docs word this differently (“1 extra node by default” vs. “usually 10%”). This lesson does not rely on the default; all labs set it explicitly.
  • Pricing: at verification time, the AKS pricing page did not show per-unit prices for the Standard/Premium tiers, so this lesson gives only relative notes and estimates. See the official pricing page and the pricing calculator for current figures.
  • Blue-green node pool upgrade strategy (--upgrade-strategy bluegreen) is in Preview. This lesson demonstrates only a manual blue-green. For managed-version parameters, follow the aks-preview docs.
  • Some error messages are marked as “illustrative.” We quote verbatim only the error text that appears in the official docs (such as UpgradeBlockedOnDeprecatedAPIUsage, NotAllAgentPoolOrchestratorVersionSpecifiedAndUnchanged, PDB eviction failures, x509). The rest are descriptions of common symptoms.
  • The cost analysis agent Pod name and some JMESPath field paths in az aks show (such as metricsProfile.costAnalysis and upgradeSettings.undrainableNodeBehavior) were not verified on a live cluster. The lesson notes “follow the actual output.”
  • The animations and calculator are simplified teaching models. The surge animation follows the official 6-step process. The cost calculator splits costs by CPU only, while real OpenCost also considers memory, GPU, storage, and network.
  • The EKS / GKE comparisons are for conceptual reference only. Their current durations and prices were not verified item by item.