How to get resource usage of different (fake) nodes #1003
Replies: 2 comments 1 reply
-
Lucky for you, the docs in #975 #1004 have just been advanced, but are still incomplete. https://kwok.sigs.k8s.io/docs/user/metrics-configuration/ |
Beta Was this translation helpful? Give feedback.
-
That's great ! thank you @wzshiming, I tried it as mentioned in the docs and it's working well. On a side question: Is there a way I could access the resource usage of the nodes through a REST API (using their endpoint) ? I can't seem to get the path correctly, I tried running Thanks |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have a project where I'm tasked to build a custom scheduler, this scheduler will use real-time information about CPU and RAM usage of each node in the cluster. I'm using Kwok in order to simulate the cluster and create a large number of nodes.
I created a fake cluster with 8 fake nodes with different CPU and RAM capacities, when I run
kubectl top nodes
it tells me that the Metrics API is not available. Is there any way I can get the current CPU/RAM usage of those fake nodes ?To better explain this, imagine we have a node with 6 cores and 16GB of RAM, and we deploy a fake pod that requests 2 CPU and 4GB of RAM, and another pod with 1 CPU and 2GB of RAM, then the current usage of the node would 3 CPU cores and 6GB of RAM.
Is there any way to get these metrics directly without having to loop through the definitions of the YAML pod and running the calculation.
kwok version:
v0.5.1 go1.21.7
Thank you
Beta Was this translation helpful? Give feedback.
All reactions