Is there a way to obtain hardware information (e.g. number of CPU cores, capacity of RAM) of an OpenShift 3.0 node programmatically? I could not find anything useful in the API references for OpenShift or Kubernetes (except for NodeSystemInfo
in the Kubernetes API, which does not contain most of the hardware-level specs).
The Kubernetes NodeStatus
has a field called Capacity
, which is a list of resources with their corresponding amounts.
You can also see the Capacity in the output of kubectl describe nodes
e.g.
$ kubectl describe nodes my-node-1
Name: my-node-1
...
Capacity:
cpu: 1
memory: 3801020Ki
pods: 110
There is a readonly stat endpoint exposed on both Openshift and Kubernetes. Normally it is exposed as https://api-host:10250/stats