Repository navigation
Add Prometheus + Alertmanager StatefulSet readiness to kube-prometheus-stack check #1247
Description
Summary
Follow-up to PR #1245 (closed #1222, closed epic #660). Add
StatefulSet readiness assertions for the Prometheus and
Alertmanager workloads shipped by the kube-prometheus-stack
chart, which PR #1245 deferred because the chart's exact StatefulSet
names and label conventions need verification.
Background
PR #1245 enhanced recipes/checks/kube-prometheus-stack/health-check.yaml
with universal container-state error coverage but stopped short of
asserting the StatefulSet workloads the stack ships:
Prometheus(via theprometheus.monitoring.coreos.comCR; the
operator creates a StatefulSet named per chart fullname template)Alertmanager(same pattern via thealertmanager.monitoring.coreos.comCR)
Today's check only asserts the kube-prometheus-operator Deployment
- label-scoped pod-phase / container-state errors in the monitoring
namespace. A scenario where the operator is healthy but Prometheus
itself is stuck (Pending pods, PVC binding failures, scrape config
errors) would silently pass.
Why deferred
The chart's StatefulSet names depend on the Prometheus / Alertmanager
CR names (e.g., prometheus-<cr-name>, alertmanager-<cr-name>),
which in turn depend on the chart's prometheus.prometheusSpec.name
/ alertmanager.alertmanagerSpec.name values or the chart's default
naming. Without live-cluster confirmation (or a chart-template render
against the pinned values file), guessing the names risks a typo'd
assertion that fails on real deployments.
Approach
- Render the chart at its pinned version with AICR's
recipes/components/kube-prometheus-stack/values.yamlapplied:
helm template <release> prometheus-community/kube-prometheus-stack --version <pin> -f values.yaml(release namekube-prometheus
matches AICR's ComponentRef Name). - Enumerate the actual StatefulSet and CR
metadata.namevalues
from the rendered output. - Add asserts to
recipes/checks/kube-prometheus-stack/health-check.yaml:PrometheusCR exists andstatus.conditions[?type == 'Available'].status == "True"(or the chart's equivalent
readiness condition).AlertmanagerCR same.- StatefulSet
readyReplicas >= replicasfor each, as a deeper
workload-level signal that the CRs actually reconciled into
running pods.
- Live-cluster validation against any recipe that enables
kube-prometheus-stack (e.g., conformance overlays).
Acceptance Criteria
recipes/checks/kube-prometheus-stack/health-check.yamlasserts
both thePrometheusandAlertmanagerStatefulSets reach full
rollout (readyReplicas >= replicaswith a vacuous-pass guard).- Optional but recommended: also assert the corresponding
Prometheus/AlertmanagerCRs report a reconciled condition. - Allowlist sweep + registry lint guard remain green.
- Live-cluster validation documented in the PR description.
Related
- PR feat(recipes): deepen 21 chainsaw health checks; close epic #660 #1245 (closed Enhance existing Chainsaw health checks (#660 PR 4) #1222, closed epic [EPIC] Reuse Chainsaw health checks in aicr validate --phase deployment #660) — the source of this deferral
- Epic [EPIC] Reuse Chainsaw health checks in aicr validate --phase deployment #660 — the broader chainsaw-deployment work
recipes/components/prometheus-operator-crds— the sibling
CRD-only component this check depends on (already asserts the 8
prometheus-operator CRDs Established)
Activity
mohityadav8 commentedon Jun 25, 2026
@mchmarny assign to me
mohityadav8 commentedon Jun 25, 2026
/assign