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 > Account.

  2. Click on the Integrations and Apps tile.

  3. If there are apps/integrations already installed, it will redirect to the Installed Integrations page where all the installed integrations/apps are displayed. Otherwise, the Available Integrations and Apps page is displayed.

  4. Click +ADD and search for K3s. Also you can use the All Categories dropdown list to search.

  5. Click ADD on the K3s tile.

  6. On the Configure page:

    1. Enter a name for the integration.
    2. Select one of the following Deployment 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.

  7. Click on Next. The Kubernetes integration page displays the details of the integration and YAML files.

  8. 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.
  9. 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.