Janaka Bandara
Janaka Bandara

Reputation: 1072

Programmatically Obtain Hardware Details of a Node

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

Upvotes: 2

Views: 1327

Answers (2)

Dimuthu
Dimuthu

Reputation: 8626

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

Upvotes: 1

CJ Cullen
CJ Cullen

Reputation: 5662

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

Upvotes: 1

Related Questions