CRI-O is an implementation of the Kubernetes CRI (Container Runtime Interface) to enable using OCI (Open Container Initiative) compatible runtimes. It is a lightweight alternative to using Docker as a runtime for kubernetes. It allows Kubernetes to use any OCI-compliant runtime as the container runtime for running pods.

OpsRamp supports CRI-O to discover and monitor the resource usage of your containers.

Prerequisite

Enable the metrics exporter for CRI-O To enable the metrics, create a config file, for example /etc/crio/crio.conf.d/01-metrics.conf, and add the following:

[crio.metrics]
enable_metrics = true
metrics_port = 9090

If the endpoint is not configured then, only the metrics available from socket are collected.

Deploying CRI-O

To deploy CRI-O: 

  1. Go to Setup > Integrations > Integrations
  2. From the Available Integrations section, click Compute
  3. From the Compute section, select Kubernetes.
  4. On the Kubernetes integration page, click Install
  5. In the Install Kubernetes Integration window: 
    1. Give a name to the integration. 
    2. For Deployment, select one of the following options:
      • On prem: If the CRI-O deployment is on-premises.
      • Cloud: If the CRI-O deployment is on a public cloud such as AWS. 
    3. For Container Engine, select CRI-O.
    4. Click Install.
      The Kubernetes integration page displays the details of the integration and YAML files.
  6. Navigate to kube-controller and do the following:
    1. Copy the YAML content from the OpsRamp integration page and paste it to a new file in kube-controller. For example, opsramp-agent-kubernetes.yaml

    2. Execute the following command in kube-controller: 

    kubectl apply -f <YAML file>
    Example: 
    kubectl apply -f opsramp-agent-kubernetes.yaml
    

You can change the following values in the YAML file:

  • LOG_LEVEL: By default, the value is set to warn. 
  • K8S_EVENTS: By default, the value is set to False.
  • DOCKER_EVENTS: By default, the value is set to False.
  1. Navigate to the OpsRamp console.
    1. Go to Infrastructure > Resources.
    2. Click k3s on the resource list pane.

A list of all the discovered nodes is displayed.