Skip to content

Fix: Deployments Needing Attention panel#4

Open
0hlov3 wants to merge 1 commit into
dhruviemehta:mainfrom
0hlov3:fix/resourceStatusOverview
Open

Fix: Deployments Needing Attention panel#4
0hlov3 wants to merge 1 commit into
dhruviemehta:mainfrom
0hlov3:fix/resourceStatusOverview

Conversation

@0hlov3
Copy link
Copy Markdown

@0hlov3 0hlov3 commented Sep 14, 2025

This PR fixes an issue where the Deployments Needing Attention panel rendered no results if the cluster contained deployments with the same name in different namespaces and/or multiple ReplicaSets for those deployments.

Problem

Deployment names are not globally unique in Kubernetes. Several of the PromQL expressions in the panel grouped or matched only by deployment, which leads to label collisions (or invalid many-to-many matches) when the same deployment name appears across multiple namespaces. In practice, this caused the panel to show nothing for those environments.

What I changed

  • Made the queries namespace-aware:
    • Updated aggregations from by (deployment) to by (namespace, deployment).
    • Ensured joins and label_replace steps preserve/propagate namespace alongside deployment.
    • Where applicable, used on(...) group_left(namespace, deployment) to keep joins unambiguous.
  • No visual changes to the dashboard, only query corrections.

Why this helps

  • The panel now correctly reports “needing attention” deployments per namespace, avoiding collisions between identically named deployments.
  • The change is backwards compatible: clusters without cross-namespace name overlaps still work the same, and clusters with overlaps now display expected results.

verified the fix in my cluster where:

  • Two namespaces host a deployment with the same name.

Note: I can’t guarantee the dashboard behaves exactly as originally intended across all setups and data sources, but in my environment the results look correct and significantly more reliable. Feedback and further adjustments welcome.

This fixes a Problem when multiple deployments or replicasets have the
same name in the Kubernetes Cluster but are in different namespaces.
Changelog: fixed
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.

1 participant