Introduction
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
Note
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 > Integrations > Integrations.
- From the Available Integrations section, click Compute.
- From the Compute section, select Kubernetes.
- On the Kubernetes integration page, click Install.
- In the Install Kubernetes Integration window:
- Give a suitable name to the integration.
- 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.
- For Container Engine, select CRI-O.
- Click Install.
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
Note
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.
- 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.