Cluster Overview shows cluster-wide Requests/Limits for master nodes while Usage/Capacity are node-scoped
Describe the bug
In the Cluster Overview / node role overview, when viewing the master/control-plane nodes group, CPU and Memory Usage, Capacity, and Allocatable Capacity appear to be correctly scoped to the selected master node group, but Requests and Limits appear to use cluster-wide totals instead of the selected node group.
This makes the master nodes view show impossible values such as hundreds of CPU requested and TiB of memory requested against a single 4-core control-plane node.
To Reproduce
- Open a cluster in Lens.
- Go to the Overview view.
- Select/view the master/control-plane nodes group.
- Compare the displayed CPU/Memory
RequestsandLimitswith Kubernetes API / Prometheus values scoped to the master node.
Observed behavior
For a cluster with one control-plane node and multiple worker nodes, Lens master nodes overview shows values like:
CPU Usage: 0.40
CPU Requests: ~209.65
CPU Limits: ~2992.81
CPU Allocatable Capacity: 4.00
CPU Capacity: 4.00
Memory Usage: 5.5GiB
Memory Requests: 2.6TiB
Memory Limits: 7.8TiB
Memory Allocatable Capacity: 6.8GiB
Memory Capacity: 7.8GiBThe Usage, Capacity, and Allocatable Capacity values match the selected control-plane node, but Requests and Limits match cluster-wide totals.
Expected behavior
When the Overview is scoped to master/control-plane nodes, Requests and Limits should also be scoped to pods scheduled on those nodes.
For the same control-plane node, the correct values are approximately:
CPU requests: 0.76
Memory requests: 356Mi
CPU limits: 3
Memory limits: 2569MiEvidence
metrics.k8s.io for the control-plane node returns usage matching Lens:
cpu: ~394647493n
memory: ~5751364KiPrometheus / kube-state-metrics cluster-wide CPU requests match the incorrect Lens master overview value:
sum(kube_pod_container_resource_requests{resource="cpu"})
# 209.44But node-scoped requests are correct:
sum(kube_pod_container_resource_requests{resource="cpu", node="<control-plane-node>"})
# 0.76
sum(kube_pod_container_resource_requests{resource="memory", node="<control-plane-node>"})
# 373293056 bytes (~356Mi)The metric itself has a node label, so this looks like the Overview request/limit aggregation query is not applying the selected node group filter, while usage/capacity queries are.
Environment (please complete the following information):
- Lens Version: Latest desktop version reported by user; exact About dialog value not available here
- OS: macOS
- Kubernetes server version: v1.31.7
- Installation method: not available
Logs:
Not available.
Kubeconfig:
Not attached for security reasons.
Additional context
This was verified against Kubernetes API, metrics-server, and Prometheus/kube-state-metrics. Kubernetes scheduling data appears correct; only the Lens Overview aggregation for master/control-plane node Requests/Limits appears incorrect.
Source: lensapp/lens