Check OpenShift / OKD Cluster Version and Operators Status

Posted on 80 views

In an OpenShift or OKD Kubernetes Cluster, the ClusterVersion custom resource holds important high-level information about your cluster. This information include cluster versionupdate channels and status of the cluster operators. In this article I’ll demonstrate how Cluster Administrator can check cluster version as well as the status of operators in OpenShift / OKD Cluster.

Check Cluster Version in OpenShift / OKD

You can easily retrieve the cluster version from the CLI using oc command to verify that it is running the desired version, and also to ensure that the cluster uses the right subscription channel.

# Red Hat OpenShift
$ oc get clusterversion
NAME      VERSION   AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.8.10    True        False         10d     Cluster version is 4.8.10

# OKD Cluster
$ oc get clusterversion
NAME      VERSION                         AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.7.0-0.okd-2021-05-22-050008   True        False         66d     Cluster version is 4.7.0-0.okd-2021-05-22-050008

To obtain more detailed information about the cluster status run the oc describe clusterversion command:

$ oc describe clusterversion
...output omitted...
Spec:
  Channel:     fast-4.8
  Cluster ID:  f3dc42b3-aeec-4f4c-780f-8a04d6951595
  Desired Update:
    Force:    false
    Image:    quay.io/openshift-release-dev/[email protected]:53576e4df71a5f00f77718f25aec6ac7946eaaab998d99d3e3f03fcb403364db
    Version:  4.8.10
Status:
  Available Updates:
    Channels:
      candidate-4.8
      candidate-4.9
      fast-4.8
    Image:    quay.io/openshift-release-dev/[email protected]:c3af995af7ee85e88c43c943e0a64c7066d90e77fafdabc7b22a095e4ea3c25a
    URL:      https://access.redhat.com/errata/RHBA-2021:3511
    Version:  4.8.12
    Channels:
      candidate-4.8
      candidate-4.9
      fast-4.8
      stable-4.8
    Image:    quay.io/openshift-release-dev/[email protected]:26f9da8c2567ddf15f917515008563db8b3c9e43120d3d22f9d00a16b0eb9b97
    URL:      https://access.redhat.com/errata/RHBA-2021:3429
    Version:  4.8.11
...output omitted...

Where:

  • Channel: fast-4.8 – Displays the version of the cluster the channel being used.
  • Cluster ID: f3dc42b3-aeec-4f4c-780f-8a04d6951595 – Displays the unique identifier for the cluster
  • Available Updates: Displays the updates available and channels

Review OpenShift / OKD Cluster Operators

OpenShift Container Platform / OKD cluster operators are top level operators that manage the cluster. Cluster operators are responsible for the main components, such as web console, storage, API server, SDN e.t.c.

All the information relating to cluster operators is accessible through the ClusterOperator resource. It allows
you to access the overview of all cluster operators, or detailed information on a given operator.

To retrieve the list of all cluster operators, run the following command:

$ oc get clusteroperators
NAME                                       VERSION   AVAILABLE   PROGRESSING   DEGRADED   SINCE
authentication                             4.8.10    True        False         False      2d14h
baremetal                                  4.8.10    True        False         False      35d
cloud-credential                           4.8.10    True        False         False      35d
cluster-autoscaler                         4.8.10    True        False         False      35d
config-operator                            4.8.10    True        False         False      35d
console                                    4.8.10    True        False         False      10d
csi-snapshot-controller                    4.8.10    True        False         False      35d
dns                                        4.8.10    True        False         False      35d
etcd                                       4.8.10    True        False         False      35d
image-registry                             4.8.10    True        False         False      35d
ingress                                    4.8.10    True        False         False      35d
insights                                   4.8.10    True        False         False      35d
kube-apiserver                             4.8.10    True        False         False      35d
kube-controller-manager                    4.8.10    True        False         False      35d
kube-scheduler                             4.8.10    True        False         False      35d
kube-storage-version-migrator              4.8.10    True        False         False      10d
machine-api                                4.8.10    True        False         False      35d
machine-approver                           4.8.10    True        False         False      35d
machine-config                             4.8.10    True        False         False      35d
marketplace                                4.8.10    True        False         False      35d
monitoring                                 4.8.10    True        False         False      3d5h
network                                    4.8.10    True        False         False      35d
node-tuning                                4.8.10    True        False         False      10d
openshift-apiserver                        4.8.10    True        False         False      12d
openshift-controller-manager               4.8.10    True        False         False      34d
openshift-samples                          4.8.10    True        False         False      10d
operator-lifecycle-manager                 4.8.10    True        False         False      35d
operator-lifecycle-manager-catalog         4.8.10    True        False         False      35d
operator-lifecycle-manager-packageserver   4.8.10    True        False         False      18d
service-ca                                 4.8.10    True        False         False      35d
storage                                    4.8.10    True        False         False      35d

Key Columns in the ouptut:

  • NAME – Indicates the name of the operator.
  • AVAILABLE – Indicates operator state if successfully deployed or has issues. TRUE means the operator is deployed successfully and is available for use in the cluster. The degraded state means the current state does not match its desired state over a period of time.
  • PROGRESSING – Indicates whether an operator is being updated to a newer version by the cluster version operator. True means update in pending completion.
  • DEGRADED – This entry returns the health of the operator. True means the operator encounters an error that prevents it from working properly.

You can limit the output to a single operator:

$ oc get co authentication
NAME             VERSION   AVAILABLE   PROGRESSING   DEGRADED   SINCE
authentication   4.8.10    True        False         False      2d14h

To get more information about an operator use:

$ oc describe clusteroperators 

Example:

$ oc describe co authentication

If you’re in a process of upgrading your OpenShift / OKD cluster from one minor version to another, we have a guide dedicated to upgrade shared in the link below:

coffee

Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.