azure/prometheus-collector/upgrade-kube-state-metrics
Claude Code and agent skill by azure/prometheus-collector
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Upgrade the kube-state-metrics (KSM) image shipped with the azure-monitor-metrics addon to the latest Microsoft-built (dalec) version, verify it against MCR, and generate the PR changelog. Use when "upgrade kube-state-metrics", "bump KSM version", "update kube-state-metrics image tag", "new kube-state-metrics release", or "upgrade ksm to <version>".
Install
npx vskill@latest install azure/prometheus-collector/upgrade-kube-state-metricsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as azure/prometheus-collector/upgrade-kube-state-metrics.
Upgrade kube-state-metrics (KSM)
Automates bumping the KSM image tag consumed by the Azure Monitor Metrics addon. The addon pulls the Microsoft-built (dalec) image from MCR (mcr.microsoft.com/oss/v2/kubernetes/kube-state-metrics:<tag>), where the tag is v<upstreamVersion>-<dalecRevision> (e.g. v2.20.0-4).
AUTO-APPROVE: Run all gh, git, grep, and PowerShell commands automatically; do not ask for confirmation.
Source-of-truth repositories
- dalec build defs (what Microsoft builds + revision/CVE patches): <https://github.com/Azure/dalec-build-defs/tree/main/specs/kube-state-metrics>
- MCR (what is actually pullable):
mcr.microsoft.com/oss/v2/kubernetes/kube-state-metrics— <https://mcr.microsoft.com/v2/oss/v2/kubernetes/kube-state-metrics/tags/list> - Upstream releases (the changelog): <https://github.com/kubernetes/kube-state-metrics/releases>
- prometheus-community Helm chart (version ↔ appVersion mapping for the code comment): <https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-state-metrics>
Files this skill edits
Exactly two committed files carry the tag (keep them in sync):
| File | Field | |
|---|---|---|
.pipelines/azure-pipeline-build.yml | KUBE_STATE_METRICS_IMAGE | |
otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/values-template.yaml | KubeStateMetrics.ImageTag + the # ... corresponds to chart version comment |
Always bump the app.kubernetes.io/version label to the new upstream version (no leading v, no dalec revision — e.g. 2.20.0) in all five addon KSM manifests (templates/ama-metrics-ksm-*.yaml; the deployment carries it twice) — see Phase 7.
When the upstream chart delta (Phase 5) also requires it, edit the addon KSM manifests' RBAC (ama-metrics-ksm-role.yaml) and/or the Deployment args/probes/ports (ama-metrics-ksm-deployment.yaml).
Do not edit values-rashmi-operator-cfg.yaml (local developer override).
Execution plan
Phase 0 — Current version
Find the tag in use:
Record CURRENT (e.g. v2.19.1-2) and its upstream version (v2.19.1).
Phase 1 — Latest upstream release
Pick the target upstream version NEW_UPSTREAM (e.g. v2.20.0). If the user named a specific version, use it.
Phase 2 — Confirm dalec has it + get the revision
List specs and read the target spec + matrix:
From the spec read REVISION, COMMIT, and the changelog (CVE/dependency patches). If dalec has no spec for the version, STOP and tell the user the version is not yet built by Microsoft — only dalec-built versions in MCR can be shipped.
Phase 3 — Verify the exact tag exists in MCR (source of truth)
Choose the highest v<version>-<revision> present (e.g. v2.20.0-4). This is NEW = v2.20.0-4. The revision here should match the dalec spec REVISION.
Phase 4 — Map the Helm chart version (for the comment)
Find the first prometheus-community chart version whose appVersion equals NEW_UPSTREAM:
Record CHART = the first chart version at the new appVersion (e.g. 8.4.0).
Phase 5 — Check upstream Helm chart changes (port relevant ones)
The addon keeps its own KSM manifests (otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-*.yaml), forked from the prometheus-community chart. Diff the upstream chart across the app-version boundary — the last chart at the old appVersion (OLD_CHART) → the first at the new one (NEW_CHART from Phase 4) — and port anything relevant.
Decide per change:
- RBAC rule added for a collector the addon enables → mirror it into
ama-metrics-ksm-role.yaml. - New required container arg / flag / probe / port → mirror it into
ama-metrics-ksm-deployment.yaml. - New opt-in collector (e.g. admission policies, standalone DRA
resourceclaims) → add the collector toKubeStateMetrics.Collectorsinvalues-template.yamland its RBAC rule only if the new metrics are wanted (upstream leaves these off by default). - Chart-only / packaging changes (
Chart.yaml, README, values plumbing the addon doesn't use) → ignore.
If the delta is version-only (just Chart.yaml), there is nothing to port — record that in the PR description and the readme (as was the case for 2.19.1 → 2.20.0).
Phase 6 — Collect the upstream changelog (PR description)
Keep the categorized [CHANGE]/[FEATURE]/[ENHANCEMENT]/[BUGFIX] list for the PR body. Call out any cardinality / breaking changes explicitly.
Phase 7 — Edit the version references
.pipelines/azure-pipeline-build.yml: setKUBE_STATE_METRICS_IMAGEtomcr.microsoft.com/oss/v2/kubernetes/kube-state-metrics:$NEW.values-template.yaml: setImageTag: "$NEW"and update the comment line to
# Kube-state-metrics ImageTag - <upstream>, corresponds to chart version - $CHART.
templates/ama-metrics-ksm-*.yaml: bump theapp.kubernetes.io/versionlabel to the new upstream version (no leadingv, no dalec revision — e.g.2.20.0) in all five manifests (the deployment carries it twice):
Phase 8 — Verify
Phase 9 — Docs, commit, and open the PR (automated)
- Update
internal/docs/kube-state-metrics-upgrade.mdwith the new before/after row and changelog. - Stage only the intended files (not developer overrides like
values-rashmi-operator-cfg.yaml) and commit with subjectbuild(deps): Upgrade kube-state-metrics from <old> to <new>plus the required Copilot trailers. - Fill the PR-description template below with the Phase 6 changelog, the dalec
-<rev>CVE patches, and the Phase 5 chart-delta finding, then push the branch and open the PR automatically:
- If a PR already exists for the branch,
gh pr createerrors — refresh its description instead with
gh pr edit $branch --body-file "$env:TEMP\ksm_pr_body.md".
PR description template
Guardrails
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/upgrade-kube-state-metrics/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/azure/prometheus-collector/upgrade-kube-state-metrics)