Bootstrap FreeKB - OpenShift - List nodes using the oc get nodes command
OpenShift - List nodes using the oc get nodes command

Updated:   |  OpenShift articles

If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.

I like to think of a "machine" as OpenShift representation of a Virtual Machine, such as an Amazon Web Services (AWS) EC2 Instance, or a VMWare Virtual Machine, and then a Node, and then the pods running on the node.

There are three types of nodes.

  • edge
  • master
  • worker

The oc get nodes command will return the list of nodes.

~]$ oc get nodes
NAME                  STATUS   ROLES            AGE    VERSION
my-node-edge-lm6wz     Ready    infra,worker     519d   v1.23.5+012e945
my-node-edge-pmlls     Ready    infra,worker     519d   v1.23.5+012e945
my-node-infra-c4v5h    Ready    infra,worker     519d   v1.23.5+012e945
my-node-infra-mc8rc    Ready    infra,worker     519d   v1.23.5+012e945
my-node-infra-p9cjv    Ready    infra,worker     519d   v1.23.5+012e945
my-node-master-0       Ready    master           522d   v1.23.5+012e945
my-node-master-1       Ready    master           522d   v1.23.5+012e945
my-node-master-2       Ready    master           522d   v1.23.5+012e945
my-node-worker-lk5vm   Ready    compute,worker   61d    v1.23.5+012e945
my-node-worker-pj4r4   Ready    compute,worker   61d    v1.23.5+012e945

 

Optionally, you can include a node to only display the details for that node.

~]# oc get nodes dev001-worker-5n4fj
NAME                 STATUS    ROLES     AGE       VERSION
dev001-worker-5n4fj  Ready     worker    273d      v1.11.0+d4cacc0

 

The --output wide option can be used to display additional fields.

oc get nodes -o wide
. . .
NAME         STATUS    ROLES     AGE       VERSION          INTERNAL-IP    EXTERNAL-IP    OS-IMAGE KERNEL VERSION                              CONTAINER-RUNTIME
mynode001    Ready     infra     273d      v1.11.0+d4cacc0  10.141.115.11  10.141.115.10  Red Hat Enterprise Linux 3.10.0-1127.8.2.el7.x86_64  docker://1.13.1

 

The oc describe node command can be used to display more details for a node.

~]$ oc describe node worker-c4v5h
Name:               worker-c4v5h
Roles:              infra,worker
Labels:             region=east
Annotations:        csi.volume.kubernetes.io/nodeid: {"csi.trident.netapp.io":"worker-c4v5h"}
                    machine.openshift.io/machine: openshift-machine-api/worker-c4v5h
                    machineconfiguration.openshift.io/controlPlaneTopology: HighlyAvailable
                    machineconfiguration.openshift.io/currentConfig: rendered-worker-8ac5b93d303e41fc70d48543f68416af
                    machineconfiguration.openshift.io/desiredConfig: rendered-worker-8ac5b93d303e41fc70d48543f68416af
                    machineconfiguration.openshift.io/state: Done
                    volumes.kubernetes.io/controller-managed-attach-detach: true
CreationTimestamp:  Mon, 19 Jul 2021 14:11:58 -0500
Taints:             <none>
Unschedulable:      false
Lease:
  HolderIdentity:  worker-c4v5h
  AcquireTime:     <unset>
  RenewTime:       Wed, 20 Jul 2022 20:44:00 -0500
Conditions:
  Type             Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message
  ----             ------  -----------------                 ------------------                ------                       -------
  MemoryPressure   False   Wed, 20 Jul 2022 20:42:32 -0500   Wed, 22 Jun 2022 08:56:35 -0500   KubeletHasSufficientMemory   kubelet has sufficient memory available
  DiskPressure     False   Wed, 20 Jul 2022 20:42:32 -0500   Wed, 22 Jun 2022 08:56:35 -0500   KubeletHasNoDiskPressure     kubelet has no disk pressure
  PIDPressure      False   Wed, 20 Jul 2022 20:42:32 -0500   Wed, 22 Jun 2022 08:56:35 -0500   KubeletHasSufficientPID      kubelet has sufficient PID available
  Ready            True    Wed, 20 Jul 2022 20:42:32 -0500   Wed, 22 Jun 2022 08:56:45 -0500   KubeletReady                 kubelet is posting ready status
Addresses:
  ExternalIP:  10.84.188.91
  InternalIP:  10.84.188.91
  Hostname:    lab001-infra-c4v5h
Capacity:
  cpu:                4
  ephemeral-storage:  167220204Ki
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             24666896Ki
  pods:               250
Allocatable:
  cpu:                3500m
  ephemeral-storage:  154110139752
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             23515920Ki
  pods:               250
System Info:
  Machine ID:                             a1cb08f79bbb43e6b04f946289c83de8
  System UUID:                            c5db3c42-832d-5dd0-c979-b982d7f5f7f0
  Boot ID:                                7d17523e-8290-468d-be12-c305223a53ad
  Kernel Version:                         4.18.0-305.45.1.el8_4.x86_64
  OS Image:                               Red Hat Enterprise Linux CoreOS 48.84.202205232135-0 (Ootpa)
  Operating System:                       linux
  Architecture:                           amd64
  Container Runtime Version:              cri-o://1.21.7-3.rhaos4.8.git57607b4.el8
  Kubelet Version:                        v1.21.11+6b3cbdd
  Kube-Proxy Version:                     v1.21.11+6b3cbdd
ProviderID:                               vsphere://423cdbc5-2d83-d05d-c979-b982d7f5f7f0
Non-terminated Pods:                      (31 in total)
  Namespace                               Name                                             CPU Requests  CPU Limits  Memory Requests  Memory Limits  Age
  ---------                               ----                                             ------------  ----------  ---------------  -------------  ---
  logging-filebeat                        filebeat-5b6f8                                   100m (2%)     0 (0%)      100Mi (0%)       400Mi (1%)     160d
  openshift-cluster-node-tuning-operator  tuned-d9s5j                                      10m (0%)      0 (0%)      50Mi (0%)        0 (0%)         28d
  openshift-dns                           dns-default-bvcs9                                60m (1%)      0 (0%)      110Mi (0%)       0 (0%)         28d
  openshift-dns                           node-resolver-92btm                              5m (0%)       0 (0%)      21Mi (0%)        0 (0%)         28d
  openshift-image-registry                image-registry-7c45c5df69-4vvvf                  100m (2%)     0 (0%)      256Mi (1%)       0 (0%)         28d
  openshift-image-registry                image-registry-7c45c5df69-xqgz5                  100m (2%)     0 (0%)      256Mi (1%)       0 (0%)         28d
  openshift-image-registry                node-ca-b8pjj                                    10m (0%)      0 (0%)      10Mi (0%)        0 (0%)         28d
  openshift-ingress-canary                ingress-canary-p2d8g                             10m (0%)      0 (0%)      20Mi (0%)        0 (0%)         28d
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  Resource           Requests       Limits
  --------           --------       ------
  cpu                1878m (53%)    0 (0%)
  memory             15491Mi (67%)  11600Mi (50%)
  ephemeral-storage  0 (0%)         0 (0%)
  hugepages-1Gi      0 (0%)         0 (0%)
  hugepages-2Mi      0 (0%)         0 (0%)
Events:              <none>

 

The ssh command can be used to SSH onto a node.




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 01508f in the box below so that we can be sure you are a human.