-
-
Notifications
You must be signed in to change notification settings - Fork 2k
feat: add node-alloc view #3688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
feat(node): show requested CPU/MEM per node - Add CPU/R, %CPU/R, MEM/R, %MEM/R columns - Sum non-terminated pod requests; skip init-container overlap - Cache totals in NodeWithMetrics for both Get and List Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
render: show “n/a” for negative requested CPU/memory values Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
da1e25a to
61b3e1c
Compare
|
@v0y4g3r Thank you for this update! Perhaps an alternate way to handle this, would be to offer and child view that would compute resource usage details per node, so cluster admins can use this to provision their cluster accordingly. Given this would be a separate command, we would not penalize everyone landing in node view and looking for other specific information especially on larger clusters. What do you think? |
I agree. Could you provide more context so I can proceed? For example, do we need to add a dedicated command ( |
|
@v0y4g3r Thank you Lei! Sure. Here are my thoughts. I think we could go either way by either introducing a new k9s node view aka node-resources or Code wise we have examples of either approaches i.e pod->container views or general views like |
feat: add nodes-alloc view showing CPU/memory allocation per node Introduces a new k9s alias `nodes-alloc` (short: `na`) that lists every node together with the total CPU and memory *requested* by all non-terminated pods scheduled on it. Implementation adds NodeAlloc DAO, view, registry entries and wires it into the alias table; re-uses the existing Node renderer so columns match the standard node view but always include pod count, request CPU and requested memory. Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
perf: defer requested-resources calculation to NodeAlloc view only - Remove CPU/memory request summation from regular Node List/Get - Keep CalculateRequestedResources() solely in NodeAlloc DAO - Node view now always reports -1 for RequestedCPU/RequestedMemory - Eliminates redundant pod iteration on every node list/query Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
feat: add NodeAlloc renderer for nodes-alloc view - introduce dedicated NodeAlloc renderer dropping ROLE, TAINTS, VERSION, AGE - expose requested CPU/MEM columns and their percentages - register new renderer in Registry for client.NodeAllocGVR Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
feat: add NodeAlloc resource view with pod count and resource requests - Introduce NodeAlloc GVR and supporting DAO, render, view layers - Count scheduled pods and aggregate CPU/memory requests per node - Surface requested vs allocatable percentages in the UI - Include comprehensive unit tests for core logic Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
ui: drop requested CPU & memory columns from node view Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
a2c9885 to
80d1709
Compare
|
@derailed Happy Thanksgiving! I made some changes to this PR in this holiday as we discussed above, please take another look |
Related issues:
Main changes
This PR introduces a new
nodes-allocview that provides detailed resource allocation information for Kubernetes nodes, including CPU and memory requests from all pods scheduled on each node. The view is optimized for capacity planning and resource utilization analysis.Motivation
The standard nodes view shows node capacity and current usage, but doesn't display the total requested resources from pods. This makes it difficult to:
The new
nodes-allocview addresses this by always calculating and displaying requested CPU and memory resources, providing a clearer picture of resource allocation across the cluster.Changes
New Features
New
nodes-allocview (:naor:nodes-alloc)Resource Request Calculation
Performance Optimization
nodes-allocview onlynodesview no longer performs expensive pod resource calculations