Skip to main content

Prerrequisites

  • Openshift API connectivity

The plugin must be able to reach the API remotely in order to extract the information.

  • Obtaining Bearer token

It can be obtained with the following CLI command, after logging in with this one:

./oc whoami -t
  • The openshift user account must have cluster-reader permissions.

     

The cli commands to add permissions are as follows (these must be given from a privileged account)

Add a role to a user :

oc adm policy add-role-to-user <role> <user_name>

Remove a role from a user :

oc adm policy remove-role-from-user <role> <user_name>

Add a role to a user for all projects:

oc adm policy add-cluster-role-to-user <role> <user_name>

Remove a user role for all projects:

oc adm policy remove-cluster-role-from-user <role> <user_name>

Example :

image-1644427009267.png

  • The cluster-monitoring option must be activated.

This can be done with the following command :

./crc config set enable-cluster-monitoring true

Example:

openshiftmonitoing.png

To be able to have enabled a minimum of 14 gb is requested, so if we have configured the environment with less, and we activate the cluster-monitoring option we will have to add more to the machine, the minimum is 14336 in mb.

  • This file can be applied directly to configure the necessary permissions.
oc apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.4.1/components.yaml
  • You need to run this apiservice: v1beta1.metrics.k8s.io and the metrics server.
oc get apiservice
  • Tiene que estar activada la opción cluster-monitoring

The command to specify the memory is :

./crc config set memory 14336

Example:

change memory.png