Skip to content

fix(alerts): add namespace to KubePodNotReady pod_info join - #51

Open
goasl wants to merge 1 commit into
cloudoperators:mainfrom
goasl:fix/kube-pod-not-ready-namespace-join
Open

goasl wants to merge 1 commit into
cloudoperators:mainfrom
goasl:fix/kube-pod-not-ready-namespace-join

Conversation

@goasl

@goasl goasl commented Sep 1, 2026

Copy link
Copy Markdown

The KubePodNotReady expression joined kube_pod_status_phase / kube_pod_status_ready against kube_pod_info using on(pod) group_left(node). Matching on the pod name alone is not unique once two pods in different namespaces share the same name (common across Gardener shoot namespaces), which makes the vector match many-to-many and fails rule evaluation with "many-to-many matching not allowed".

Match on (pod, namespace) and carry the namespace label on the right-hand aggregation so the join is one-to-one, matching the pattern already used by the kubePodLabelsJoin helper.

Bump chart version 1.3.2 -> 1.3.3.

@goasl
goasl requested a review from a team as a code owner September 1, 2026 08:02
Copilot AI lite review requested due to automatic review settings September 1, 2026 08:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a PromQL vector-matching failure in the KubePodNotReady alert rule by ensuring the join against kube_pod_info is unique across namespaces (avoiding many-to-many matching when identically named pods exist in different namespaces). It also bumps the Helm chart version to reflect the change.

Changes:

  • Update KubePodNotReady to join kube_pod_status_* with kube_pod_info using on(pod, namespace) and preserve namespace on the RHS aggregation.
  • Apply the same (pod, namespace) join adjustment to both kube_pod_status_phase and kube_pod_status_ready subexpressions.
  • Bump chart version from 1.3.1 to 1.3.2.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
charts/kubernetes-operations/Chart.yaml Bumps chart version to 1.3.2 to publish the alert rule fix.
charts/kubernetes-operations/alerts/kubernetes-health.yaml Fixes KubePodNotReady PromQL join uniqueness by matching on (pod, namespace) and retaining namespace on the kube_pod_info side.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

goasl added a commit to goasl/greenhouse-extensions that referenced this pull request Sep 4, 2026
Pull in the KubePodNotReady alert fix from cloudoperators/kubernetes-operations#51,
which joins kube_pod_status_* against kube_pod_info on (pod, namespace) instead of
(pod) to resolve the many-to-many PromQL vector matching failure.

Propagates the dependency update per the kubernetes-operations contributing guide:
- Chart.yaml: chart 15.0.1 -> 15.0.2, dep kubernetes-operations 1.3.1 -> 1.3.2
- Chart.lock: regenerated via helm dependency update
- plugindefinition.yaml: spec.version 16.0.1 -> 16.0.2, helmChart.version 15.0.1 -> 15.0.2
- vendored chart: kubernetes-operations-1.3.1.tgz -> 1.3.2.tgz

Signed-off-by: Gökhan Aslan <g.aslan@sap.com>
The KubePodNotReady expression joined kube_pod_status_phase /
kube_pod_status_ready against kube_pod_info using `on(pod)
group_left(node)`. Matching on the pod name alone is not unique
once two pods in different namespaces share the same name (common
across Gardener shoot namespaces), which makes the vector match
many-to-many and fails rule evaluation with "many-to-many matching
not allowed".

Match on (pod, namespace) and carry the namespace label on the
right-hand aggregation so the join is one-to-one, matching the
pattern already used by the kubePodLabelsJoin helper.

Bump chart version to 1.3.3 in Chart.yaml and plugindefinition.yaml
(spec.version and helmChart.version).

Signed-off-by: Gökhan Aslan <g.aslan@sap.com>
@goasl
goasl force-pushed the fix/kube-pod-not-ready-namespace-join branch from fe08502 to aef5f4a Compare September 4, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants