Programmatically Obtain Hardware Details of a Node

5/11/2016

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).

-- Janaka Bandara
kubernetes
openshift-enterprise
openshift-origin

2 Answers

5/11/2016

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
-- CJ Cullen
Source: StackOverflow

11/3/2016

There is a readonly stat endpoint exposed on both Openshift and Kubernetes. Normally it is exposed as https://api-host:10250/stats

-- Dimuthu
Source: StackOverflow