Monitoring a Db2U custom resource status in Db2

You can find status values under any STATE column of a Db2uCluster custom resource instance.

Retrieving the status

Modify, then run the following command to retrieve the Db2U instance status:

# oc get db2ucluster <Db2uCluster CR instance name>

The following is an output example:

[root@api.deploysquad11.cp.fyre.ibm.com ~]# oc get db2ucluster db2oltp-1653604730879623
NAME                       STATE   MAINTENANCESTATE   AGE
db2oltp-1653604730879623   Ready   None               5d14h

Status states

The following is a list of possible status state values and their definition:

  • Error: A general error preventing the Db2uCluster custom resource instance from reconciling.
  • Ready: The Db2uCluster custom resource instance has reconciled and is functional.
  • Not Ready: The Db2uCluster custom resource instance has not reconciled. The formation is currently in a convergence process, such as deploying or upgrading..
  • License Error: The license provided in the Db2uCluster custom resource instance has not been accepted.

Maintenance status states

The following maintenance state values are reported under the MAINTENANCESTATE column of any Db2uCluster custom resource instance:
  • InMaintenance: The Db2U operator has paused reconciliation for maintenance, such as performing a backup, restoring from a backup, etc.
  • Shutdown: The Db2uCluster instance has been shutdown with no pods running.
  • ShutdownInProgress: The Db2U operator is shutting down the Db2uCluster instance by scaling down all deployments and StatefulSets.

Db2U instance formation status

You can monitor a Db2uCluster custom resource instance to view the status of all the Kubernetes resources that belong to the formation.

Modify, then run the following command to retrieve the instance formation status:

# export db2ucluster=<Db2uCluster CR instance name>

# oc get formations.db2u.databases.ibm.com ${db2ucluster} -o go-template='{{range .status.components}}{{printf "%s,%s,%s\n" .kind .name .status.state}}{{end}}' | column -s, -t

The following is an output example:

[root@api.deploysquad11.cp.fyre.ibm.com ~]# export db2ucluster=db2oltp-1653604730879623

[root@api.deploysquad11.cp.fyre.ibm.com ~]# oc get formations.db2u.databases.ibm.com ${db2ucluster} -o go-template='{{range .status.components}}{{printf "%s,%s,%s\n" .kind .name .status.state}}{{end}}' | column -s, -t
account                account-zen-db2oltp-1653604730879623              OK
PersistentVolumeClaim  c-db2oltp-1653604730879623-meta                   OK
PersistentVolumeClaim  c-db2oltp-1653604730879623-backup                 OK
secret                 c-db2oltp-1653604730879623-sshkeys-db2uhausr      OK
secret                 c-db2oltp-1653604730879623-sshkeys-db2uadm        OK
secret                 c-db2oltp-1653604730879623-sshkeys-db2instusr     OK
secret                 c-db2oltp-1653604730879623-ldappassword           OK
secret                 c-db2oltp-1653604730879623-ldapblueadminpassword  OK
secret                 c-db2oltp-1653604730879623-instancepassword       OK
secret                 c-db2oltp-1653604730879623-db2u-lic               OK
secret                 c-db2oltp-1653604730879623-certs-wv-rest          OK
secret                 c-db2oltp-1653604730879623-certs-db2u-api         OK
configmap              c-db2oltp-1653604730879623-db2uconfig             OK
configmap              c-db2oltp-1653604730879623-db2regconfig           OK
configmap              c-db2oltp-1653604730879623-db2dbmconfig           OK
configmap              c-db2oltp-1653604730879623-db2dbconfig            OK
configmap              c-db2oltp-1653604730879623-db2u-api               OK
Job                    c-db2oltp-1653604730879623-instdb                 OK
service                c-db2oltp-1653604730879623-etcd                   OK
StatefulSet            c-db2oltp-1653604730879623-etcd                   OK
service                c-db2oltp-1653604730879623-db2u-internal          OK
service                c-db2oltp-1653604730879623-db2u                   OK
service                c-db2oltp-1653604730879623-db2u-engn-svc          OK
service                c-db2oltp-1653604730879623-db2u-head-engn-svc     OK
StatefulSet            c-db2oltp-1653604730879623-db2u                   OK
networkpolicy          c-db2oltp-1653604730879623                        OK
networkpolicy          c-db2oltp-1653604730879623-ext                    OK
Job                    c-db2oltp-1653604730879623-restore-morph          OK

The following is a list of possible instance formation status values:

  • OK: The Kubernetes resource creation or update has completed successfully.
  • Creating: The Kubernetes resource is currently being created.
  • Updating: The Kubernetes resource is currently being updated.