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:
Go to Setup > Account.
Click on the Integrations and Apps tile.
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.
Click +ADD and search for K3s. Also you can use the All Categories dropdown list to search.
Click ADD on the K3s tile.
On the Configure page:
- Enter a name for the integration.
- 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.
- For Container Engine, select CRI-O.
Click on Next. The Kubernetes integration page displays the details of the integration and YAML files.
Navigate to kube-controller and do the following:
- 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
. - 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.
- Copy the YAML content from the OpsRamp integration page and paste it to a new file in kube-controller. For example,
Navigate to the OpsRamp console.
- Go to Infrastructure > Resources.
- Click k3s on the resource list pane.
A list of all the discovered nodes is displayed.