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 the prometheus.monitoring.coreos.com CR; the
operator creates a StatefulSet named per chart fullname template)
Alertmanager (same pattern via the alertmanager.monitoring.coreos.com CR)
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.yaml applied:
helm template <release> prometheus-community/kube-prometheus-stack --version <pin> -f values.yaml (release name kube-prometheus
matches AICR's ComponentRef Name).
- Enumerate the actual StatefulSet and CR
metadata.name values
from the rendered output.
- Add asserts to
recipes/checks/kube-prometheus-stack/health-check.yaml:
Prometheus CR exists and status.conditions[?type == 'Available'].status == "True" (or the chart's equivalent
readiness condition).
Alertmanager CR same.
- StatefulSet
readyReplicas >= replicas for 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.yaml asserts
both the Prometheus and Alertmanager StatefulSets reach full
rollout (readyReplicas >= replicas with a vacuous-pass guard).
- Optional but recommended: also assert the corresponding
Prometheus / Alertmanager CRs report a reconciled condition.
- Allowlist sweep + registry lint guard remain green.
- Live-cluster validation documented in the PR description.
Related
Summary
Follow-up to PR #1245 (closed #1222, closed epic #660). Add
StatefulSet readiness assertions for the
PrometheusandAlertmanagerworkloads shipped by thekube-prometheus-stackchart, 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.yamlwith universal container-state error coverage but stopped short of
asserting the StatefulSet workloads the stack ships:
Prometheus(via theprometheus.monitoring.coreos.comCR; theoperator creates a StatefulSet named per chart fullname template)
Alertmanager(same pattern via thealertmanager.monitoring.coreos.comCR)Today's check only asserts the
kube-prometheus-operatorDeploymentnamespace. 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.namevalues or the chart's defaultnaming. 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
recipes/components/kube-prometheus-stack/values.yamlapplied:helm template <release> prometheus-community/kube-prometheus-stack --version <pin> -f values.yaml(release namekube-prometheusmatches AICR's ComponentRef Name).
metadata.namevaluesfrom the rendered output.
recipes/checks/kube-prometheus-stack/health-check.yaml:PrometheusCR exists andstatus.conditions[?type == 'Available'].status == "True"(or the chart's equivalentreadiness condition).
AlertmanagerCR same.readyReplicas >= replicasfor each, as a deeperworkload-level signal that the CRs actually reconciled into
running pods.
kube-prometheus-stack (e.g., conformance overlays).
Acceptance Criteria
recipes/checks/kube-prometheus-stack/health-check.yamlassertsboth the
PrometheusandAlertmanagerStatefulSets reach fullrollout (
readyReplicas >= replicaswith a vacuous-pass guard).Prometheus/AlertmanagerCRs report a reconciled condition.Related
recipes/components/prometheus-operator-crds— the siblingCRD-only component this check depends on (already asserts the 8
prometheus-operator CRDs Established)