I’m new to Kubernetes, and I want to get the available memory of a node, so I used the Summary API to get the specific status of a node, finally I got a json result with other information omitted:
// curl http://localhost:8001/api/v1/nodes/{my_node_name}/proxy/stats/summary
{
"node": {
"nodeName": "master",
"systemContainers": ...,
"startTime": "2024-04-17T03:07:20Z",
"cpu": ...,
"memory": {
"time": "2024-04-29T11:46:36Z",
"availableBytes": 1989132288,
"usageBytes": 3017809920,
"workingSetBytes": 1964838912,
"rssBytes": 1445163008,
"pageFaults": 70987132,
"majorPageFaults": 149
},
...
},
...
}
Is availableBytes
the result I want?
How does cAdvisor obtain this value? I found that this value is different from that displayed by the free
command. Doesn’t this value come from /proc/meminfo?
I checked https://github.com/google/cadvisor but still got no answers.
Geraint is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.