How to find the number of CPU Units for a Kubernetes node

The OpsLogix Kubernetes MP is licensed per number of CPU Units in a Kubernetes node. This article will show you how to retrieve the number of CPU Units per Kubernetes node so you can calculate the number of licenses needed for the Kubernetes MP

CPU Units in Kubernetes explained.

Depending on the platform you are using Windows / Linux open a new CMD Window of for Linux open a new terminal.

Linux

  1. Open a new terminal or ssh session on the linux machine which has kubectl installed. If you do not have kubectl installed please check this for instructions on how to install kubectl.
  2. Make sure that the config file in the ~/.kube directory has sufficient permissions to query all the nodes in the Kubernetes cluster.
  3. Type the command below on the prompt:
    kubectl describe nodes

    The output will give you a long list of information about each node, if the list is too long consider adding the name of the node behind the command:

    kubectl describe nodes <node-name>

    To find the number of CPU's in a node you need to look for the Capacity section in the list. Under capacity you will find the header cpu: with the number of CPU's for the node. To find the total number of CPU's for a cluster you will need to examine each node as described.

Windows

  1. Open a new CMD window on the Windows machine which has kubectl installed. If you do not have kubectl installed please check this for instructions on how to install kubectl.
  2. Make sure that the config file exists (or is copied to) the C:\Users\<username>\.kube profile directory and has sufficient permissions to query all the nodes in the Kubernetes cluster.
  3. Type the command below on the prompt:
    kubectl describe nodes

    The output will give you a long list of information about each node, if the list is too long consider adding the name of the node behind the command:

    kubectl describe nodes <node-name>

    To find the number of CPU's in a node you need to look for the Capacity section in the list. Under capacity you will find the header cpu: with the number of CPU's for the node. To find the total number of CPU's for a cluster you will need to examine each node as described.