OpenShift Monitoring in Rest API Mode

OpenShift Monitoring in Rest API Mode

For the OpenShift monitor, data collection when carried out using SSH mode sometimes results in timeout exception due to the presence of large amount of data to be collected. To avoid this, an enhancement has been made and now data collection will take place using Rest API mode for major metrics.

To add OpenShift monitor using Rest API mode, please follow the below steps:
  1. Go to the new monitor page and choose OpenShift under Virtualization category.
  2. After providing the necessary host details, enable the "Collect Major metrics using Rest API" option.
  3. Provide the Web socket port details and the Service Account Token generated from the Openshift cluster to be monitored(follow the later part of this KB for the steps to generate Service Account Token).
Note: For the Service Account Token, the user should ensure that "Cluster Reader Privilege" is assigned for the Service account used to generate the token.
Steps to obtain service account token:
  1. In the machine where OpenShift is installed, create the service account using the below command:
    1. oc create serviceaccount apm -n default
  2. Assign cluster reader role to the Service account created (apm in our case, as mentioned in the above command):
    1. oc create clusterrolebinding apm-cluster-reader -n default --clusterrole=cluster-reader --serviceaccount=default:apm
  3. To get the service account token, please execute the below command to be used in the add monitor page:
    1. oc serviceaccounts get-token apm -n default
Note: apm is an example user. It can be modified to create a new user or provide the username for the existing user from the OpenShift environment.

                  New to ADSelfService Plus?