fix(observability): do not fire KubePodNotReady for terminating pods #7287
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.63) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.63 · 303 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.342
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.063
Real PR Conversation Timeline
1 comments
"Review active on #7287"
general
weight: 0.35
stevekuznetsov
Summary
KubePodNotReadyfires on pods that are intentionally terminating during cluster teardown. The upstream expression keys on pod phase and does not exclude pods carrying adeletionTimestamp, so a gracefully-terminating HCP control-plane pod (e.g.kube-apiserverduring deprovision) is treated like a genuinely stuck one.This adds a deletion-timestamp exclusion to the expression:
Genuinely stuck pods (no deletion timestamp) still alert, so serving-cluster coverage is unchanged.
Change scope
The alert rule is vendored/generated, so the only hand-edited rule source is the maintained
.diffpatch; every deployable artifact is regenerated through the observabilityMakefile(not hand-edited). The PR therefore spans:observability/alerts/kubernetesControlPlane-prometheusRule.yaml.diff— maintained patch (only hand-edited rule source)observability/alerts/kubernetesControlPlane-prometheusRule.yaml— regenerated ruleobservability/alerts/kubernetesControlPlane-prometheusRule_test.yaml— new regression test (terminating pod silenced; non-terminating NotReady still fires, incl. cross-cluster isolation)dev-infrastructure/modules/metrics/rules/generatedMsftPrometheusAlertingRules.bicep,generatedKustoOnlyServicePrometheusAlertingRules.bicep,generatedKustoOnlyHCPPrometheusAlertingRules.bicep— regenerated deployable Bicep (the artifacts the deployment modules import)observability/alerts-msft-services.yaml,observability/alerts-kusto-services.yaml,observability/alerts-kusto-hcps.yaml— promote the rule fromuntestedRulesto a tested config so the generator discovers and runs the new regression testtest/util/alertdiagnostics/testdata/zz_fixture_TestRepositoryCorpus.yaml— regenerated corpus fixtureVerification
promtoolvalidates all rules; the regression test runs and passes in all three consuming configs.make fmtclean; relevant lint clean; working tree clean.Tracking
No separate tracking issue — this is a self-contained CI/observability fix identified during analysis of the
KubePodNotReadyalert firing on terminating HCP control-plane pods during cluster teardown.---
AI-generated. Review for accuracy.
@machi1990 requested from Slack