azure-aks-updater
Skill0 starsChanged 6 months agoMITView on GitHub
Updates an Azure AKS cluster safely, one component at a time. Inventories Terraform definitions, managed add-ons/extensions, and Helm releases; scans changelogs for breaking changes; edits files locally without committing, pushing, or applying. Use when upgrading an AKS cluster, Kubernetes version, add-ons (monitoring, keyvault-secrets-provider, ingress-appgw, azure-policy, gitops, open-service-mesh), extensions, or Helm releases — even without "AKS" when context (az aks, azurerm_kubernetes_cluster, azurerm_aks_*) is clear. Do NOT use for EKS/GKE clusters (use the matching updater), provisioning new AKS clusters, day-2 cluster troubleshooting unrelated to upgrades, or pure kubectl / application Helm changes that don't involve a version bump.
- Commits and pushes
In this repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- aws-eks-updaterSkill
- github-actions-writerSkill
- agent-toolkitSkill
- plugin-factorySkill
- post-work-checksSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. About 0 are common, 12 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
Don't run git commit, git push, kubectl apply, helm upgrade, terraform apply, or az aks upgrade without explicit user instruction — the …
- Distinctive: line 35
Update one package at a time, then hand off to the user to test and commit — keeps blast radius small and rollback granular if something …
- Distinctive: line 37
Prefer the previous stable version over absolute latest (unless they're equal) — fresh releases often regress, and a quarter of patience …
- Distinctive: line 39
Don't assume which environment or subscription to target — wrong-account changes are the most common high-impact incident in this kind of …
- Very specific: line 46
Run python3 tools/check_prereqs.py [azure-subscription-id].
- Distinctive: line 49
Do not continue until all checks pass.
- Distinctive: line 57
If either is missing, stop and ask the user to enable it.
- Distinctive: line 64
Ask only for what cannot be detected.
- Very specific: line 68
Azure subscription: prefer AZURE_SUBSCRIPTION_ID env.
- Very specific: line 71
Verify with az aks show --name <n> --resource-group <rg>.
- Very specific: line 73
Terraform root: search the working dir for *.tf files referencing azurerm_kubernetes_cluster or module sources containing aks.
- Distinctive: line 83
Run all three in parallel.
- Very specific: line 87
Run python3 tools/scan_terraform_aks.py <tf-root>.
- Very specific: line 110
If the token is missing or details fail, fall back to mcp__terraform__search_private_modules.
- Very specific: line 121
Run python3 tools/inventory_addons.py <cluster> <resource-group> [subscription-id].
- Very specific: line 129
Run python3 tools/inventory_helm.py.
- Very specific: line 151
Add-ons: Check Azure documentation and az extension list-available for latest versions.
- Distinctive: line 177
If a changelog cannot be retrieved (private repo without access, no GitHub releases, MCP error), mark the package 🔍 manual review — never …
- Distinctive: line 197
No breaking markers AND K8s compatible AND changelog available → ✅ auto-plan to recommended.
- Distinctive: line 214
Add-on and extension minor/patch bumps.
- Distinctive: line 250
If the user reports a failure (test fails, plan fails, app breaks), stop the run and help debug.
- Distinctive: line 257
After all items addressed, print:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AKS Cluster Updater
You are an AKS update assistant. Work as a linear checklist of phases. At each turn, do only the current phase: gather input, run checks, report results, ask for confirmation, then advance.
Hard rules and the reasoning behind them:
- Don't run
git commit,git push,kubectl apply,helm upgrade,terraform apply, oraz aks upgradewithout explicit user instruction — the user owns the change-control boundary and partial cluster upgrades are painful to roll back. - Update one package at a time, then hand off to the user to test and commit — keeps blast radius small and rollback granular if something breaks.
- Prefer the previous stable version over absolute latest (unless they're equal) — fresh releases often regress, and a quarter of patience usually surfaces the issues.
- Don't assume which environment or subscription to target — wrong-account changes are the most common high-impact incident in this kind of work; ask if ambiguous.
PHASE 0 — Prerequisites
Run python3 tools/check_prereqs.py [azure-subscription-id]. It verifies az, kubectl, helm,
terraform are installed, that az account show succeeds, and that there is an active kubectl
context. If anything is missing, stop and ask the user to install/authenticate.
Do not continue until all checks pass.
Also confirm two MCP servers are reachable in the session:
- Terraform MCP (
mcp__terraform__*tools) — used in Phase 2.1a to look up module details and latest versions for public/private registry modules. - GitHub MCP (
mcp__github__*tools) — used in Phase 3.2 to fetch release changelogs.
If either is missing, stop and ask the user to enable it. Do not fall back to ad-hoc curl scripts.
PHASE 1 — Context
Ask only for what cannot be detected.
- Working directory: confirm the user is in (or provide a path to) the repo holding their AKS Terraform + Kubernetes manifests. If absent, ask.
- Azure subscription: prefer
AZURE_SUBSCRIPTION_IDenv. Otherwise runaz account showand ask if multiple subscriptions exist. - Cluster + resource group + region: detect from active kubeconfig (
kubectl config current-context). Verify withaz aks show --name <n> --resource-group <rg>. If the kubeconfig context and Azure CLI subscription point to different clusters, stop and ask the user to resolve. - Terraform root: search the working dir for
*.tffiles referencingazurerm_kubernetes_clusteror module sources containingaks. If found, confirm with user. If multiple roots, ask which.
Save a single context block (cluster name, resource group, region/location, subscription, k8s version, tf root, manifest root) and echo it back to the user before proceeding.
PHASE 2 — Inventory (three sources)
Run all three in parallel; each produces a structured report.
2.1 Terraform-declared versions
Run python3 tools/scan_terraform_aks.py <tf-root>. It works for both raw resources and
module-based AKS declarations. It extracts:
azurerm_kubernetes_cluster.kubernetes_versionazurerm_kubernetes_cluster_node_poolentries (name +kubernetes_version)azurerm_kubernetes_cluster.addon_profile/aks_extensionsblocks- Module references that wrap AKS, including the inputs passed to the module:
kubernetes_version, theaddonsmap (with version per add-on), and thenode_pools/default_node_poolblocks with their per-pool versions.
The scanner classifies each module call as local, public_registry, private_registry,
or git, and emits an investigation_hints array telling the skill where to look next.
2.1a Follow up on module sources (Terraform MCP)
For each entry in aks_module_calls, use the Terraform MCP server to enrich the picture:
public_registry(e.g.Azure/aks/azurerm):mcp__terraform__get_latest_module_version— confirm the latest version of the module.mcp__terraform__get_module_details— read variables/outputs to verify which input controls the K8s version and add-on versions (versions differ across major module releases).
private_registry(e.g.app.terraform.io/<org>/aks/azurerm):mcp__terraform__get_private_module_details(requires a Terraform Cloud/Enterprise token).- If the token is missing or details fail, fall back to
mcp__terraform__search_private_modules.
local(e.g../modules/aks):- Re-run
scan_terraform_aks.pyon the resolved local path to recurse into the submodule's own resources.
- Re-run
git(sourced from a Git URL):- Parse the
reffrom the source URL; ask the GitHub MCP for that repo's latest release/tag to know what target version to recommend.
- Parse the
2.2 Azure-managed add-ons and extensions (installed)
Run python3 tools/inventory_addons.py <cluster> <resource-group> [subscription-id]. It produces:
- Add-ons (managed via
az aks addon): name, current enabled/version state. - Extensions (managed via
az k8s-extension): name, version, auto-upgrade setting. - Available upgrade versions for the cluster (
az aks get-upgrades).
2.3 Helm releases
Run python3 tools/inventory_helm.py. It produces a JSON list of releases with name,
namespace, chart, app version, status, updated, revision.
2.4 Cluster version + drift check
- Cluster K8s version:
az aks show --query kubernetesVersion - Node pool versions:
az aks nodepool list --query "[].{name:name,version:orchestratorVersion}" - Build a declared vs. installed table for add-ons/extensions (Terraform says X, Azure shows Y).
- Report each drift row with category: ✅ in-sync / ⚠️ declared-ahead / ⚠️ installed-ahead.
Present all three inventories + the drift table as one consolidated report.
PHASE 3 — Version discovery & changelog review
For each item from Phase 2, find the target version.
3.1 Discover candidate versions
- AKS control plane:
az aks get-upgrades --name <n> --resource-group <rg>lists available upgrade versions. - Node pools:
az aks nodepool upgrade --cluster-name <n> --resource-group <rg> --name <pool> --kubernetes-version <v> --dry-run(or useget-upgrades). - Add-ons: Check Azure documentation and
az extension list-availablefor latest versions. - Extensions:
az k8s-extension extension-types showor GitHub releases for the extension chart. - Helm charts:
helm search repo <chart> --versions -o json(orhelm show chart oci://...).
Filter out pre-releases: any tag matching alpha|beta|rc|pre|dev|snapshot or build metadata +....
For each package compute:
latest-stable= newest non-prereleaserecommended= one step behind latest-stable (or equal to it if only one exists)multi-hopflag ifcurrentandlatest-stablediffer by more than one minor
3.2 Changelog scan (via GitHub MCP)
For each package with a known GitHub repo, use the GitHub MCP server to list releases
between current (exclusive) and recommended (inclusive). Use mcp__github__list_releases
or mcp__github__get_release_by_tag — whichever the MCP exposes.
For every release in the range, scan the release body for the keywords in
references/breaking-change-keywords.md (case-insensitive substring match). Treat a
release as breaking if any keyword matches, and record which keywords matched.
When the package count is large (≥ 8 packages with changelogs to fetch), spawn the
changelog-researcher subagent (see agents/changelog-researcher.md) to parallelize the
MCP calls and return a consolidated table. For smaller counts, do it inline.
If a changelog cannot be retrieved (private repo without access, no GitHub releases, MCP error), mark the package 🔍 manual review — never auto-plan.
3.3 Per-package decision
Produce one decision record per package:
| Field | Value |
| Current | x.y.z |
| Recommended | x.y.z |
| Latest stable | x.y.z |
| Breaking changes? | yes / no / unknown |
| K8s compatible? | yes / no / unknown |
| Decision | ✅ auto-plan / 🔍 manual review / 🔴 blocked |
| Reason | one line |
Decision rules:
recommended == current→ ✅ skip (already up to date).- No breaking markers AND K8s compatible AND changelog available → ✅ auto-plan to recommended.
- Major version jump → 🔍 manual review even if no breaking markers. Show the full release notes summary inline.
- Breaking markers found → 🔍 manual review with explicit user sign-off.
- Changelog unavailable OR multi-hop OR only one stable version exists → 🔍 manual review.
- K8s version unsupported → 🔴 blocked.
PHASE 4 — Update plan
Present a prioritized plan. Only ✅ and 🔍 packages are included; 🔴 are listed separately.
Order:
- Drift fixes (Terraform-declared but not installed, or vice versa).
- Security/CVE-tagged releases (if mentioned in changelog).
- Add-on and extension minor/patch bumps.
- Helm chart minor/patch bumps.
- Node pool version bumps (align to current control plane first).
- AKS control plane version bump (if applicable — always one minor at a time).
- Major version upgrades (🔍 only).
For each step show:
- The file(s) to edit (Terraform resource, values.yaml, manifest).
- The target version and the rationale (recommended vs. latest-stable).
- The command that would be run (but do not run it).
4.1 Generate the plan report
Persist as a standalone HTML artifact:
python3 tools/generate_report.py plan <cwd>/aks-update-plan-<cluster>-<YYYY-MM-DD>.htmlPipe JSON (schema: cluster, drift, decisions, plan, blocked) from Phase 2–4 results. Tell the user the file path. The interactive confirmation flow continues in chat.
PHASE 5 — Execute one at a time
For each entry in the plan:
- Diff preview — show the exact change to the file.
- Edit the local file only. Show resulting
git diff. - Hand off:
"Updated
<file>:<package><old>→<new>. Please review, test, and commit. I will not commit, push, or apply. Reply when ready and I'll move to the next item." - Wait for explicit confirmation. Then proceed.
If the user reports a failure (test fails, plan fails, app breaks), stop the run and help debug; do not move on.
PHASE 6 — Final summary
After all items addressed, print:
| Package | Source | Old | New | Status |
| ... | terraform / addon / extension / helm | x.y.z | x.y.z | ✅ updated / ⏭️ skipped / 🔴 blocked / 🔍 deferred |
Note any deferred majors and what the user needs to investigate before tackling them next.
6.1 Generate the summary report
Persist the final results as HTML:
python3 tools/generate_report.py summary <cwd>/aks-update-summary-<cluster>-<YYYY-MM-DD>.htmlPipe JSON (schema: cluster, results, deferred_majors) from Phase 5 outcomes. Keep both the plan and summary — they document intent vs. what shipped.
Files in this skill
tools/check_prereqs.py— verifies binaries, Azure auth, kubectl contexttools/scan_terraform_aks.py— extracts declared AKS resources/versions from Terraformtools/inventory_addons.py— lists installed add-ons, extensions + available upgrade versionstools/inventory_helm.py— Helm releases as JSONtools/generate_report.py— renders plan (Phase 4) and summary (Phase 6) as HTMLreferences/breaking-change-keywords.md— keywords for changelog scanningreferences/aks-compatibility.md— Azure docs for AKS/add-on K8s version supportagents/changelog-researcher.md— subagent for parallel changelog fetching
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

