Gathering diagnostics from services

Use the cpd-cli health command-line interface to assess the health of your Red Hat® OpenShift® cluster and your IBM® Software Hub installation. Use the cpd-cli diag command-line interface to gather diagnostics on the installed services.

Before you begin

Before you run any cpd-cli health or cpd-cli diag commands, complete the following prerequisites.

Checking the health of your cluster

You can use any of the cpd-cli health commands to perform regular health checks or to provide more information when you open a case with IBM Support.

  • Perform a health check on cluster resources, such as machine config pools, cluster operators, and the Kubernetes etcd cluster. There is also a connectivity test to see whether allowlisted URLs for air-gapped installation are accessible (for example, https://icr.io, https://github.com/IBM, and https://mirror.openshift.com/pub). You must log in to the Red Hat OpenShift Container Platform as a cluster administrator to use this command.

    cpd-cli health cluster
  • Perform a health check on node resources and usage. You must log in to the Red Hat OpenShift Container Platform as a cluster administrator to use this command.

    cpd-cli health nodes
  • Run a health check on operand namespace resources. This command includes checks on the control plane namespace and any tethered namespaces. Resources include StatefulSets, deployments, pods, persistent volume claims, add-on services, and IBM Software Hub service custom resources. There is also a IBM Software Hub platform check to see whether URLs for various control plane components are accessible. You must log in to the Red Hat OpenShift Container Platform as a cluster administrator to use this command.

    cpd-cli health operands --control_plane_ns=${PROJECT_CPD_INST_OPERANDS} --verbose
  • Perform a health check on operator namespace resources. This command includes checks on cluster service versions, catalog sources, subscriptions, deployments and pods. You must log in to the Red Hat OpenShift Container Platform as a cluster administrator to use this command.

    cpd-cli health operators --control_plane_ns=${PROJECT_CPD_INST_OPERANDS} --operator_ns=${PROJECT_CPD_INST_OPERATORS}
  • Check storage performance on your cluster.

    cpd-cli health storage-performance --param param.yml
  • Check storage validation on your cluster.

    cpd-cli health storage-validation --param param.yml

For more information, see health.

Gathering diagnostics

You can use the cpd-cli diag commands to check health and gather diagnostics for services.

Every cpd-cli diag command requires you to specify your own --profile name. The following commands use the default profile named default.

  • To list the services on an instance, run the following command.

    cpd-cli diag list-services --profile=${CPD_PROFILE_NAME} -o type

    For the output type, you can specify json, yaml, or text. The default output type is text.

  • To retrieve the diagnostics logs from a service, run the following command.

    cpd-cli diag gather-diagnostics product-id --profile=${CPD_PROFILE_NAME}
  • To list the diagnostics jobs, run the following command.

    cpd-cli diag list-jobs --profile=${CPD_PROFILE_NAME}
  • To download the diagnostics logs for a job, run the following command.

    cpd-cli diag download-logs job-id --profile=${CPD_PROFILE_NAME}
  • To delete the diagnostics job, run the following command.

    cpd-cli diag delete-job job-id --profile=${CPD_PROFILE_NAME}

For more information, see diag.