CRI-O: A Container Runtime Every DevOps and SRE Engineer Should Know

Matías Salinas
3 min readMar 13, 2023

--

Containerization has become a popular technology for running applications in modern software development. With containers, DevOps and SRE engineers can easily create, deploy, and manage applications in a consistent and reliable manner. However, to work with containers effectively, engineers need to know how to use container runtimes, such as CRI-O.

CRI-O is a container runtime developed specifically for Kubernetes. It is a lightweight and fast runtime that supports the Kubernetes Container Runtime Interface (CRI) specification. CRI-O is designed to run any OCI-compliant container image, making it compatible with a wide range of container images and registries.

One of the key advantages of CRI-O over Docker is that it does not include the Docker daemon or any unnecessary components, reducing the attack surface and minimizing the overhead. This makes CRI-O more secure and efficient, especially in Kubernetes environments where container orchestration is already provided by Kubernetes.

To understand CRI-O, engineers must learn the basic commands for interacting with it. One such command is crictl, which is a CLI tool for managing CRI-O containers and images. crictl allows users to create, start, stop, and remove containers, as well as inspect images and containers, and pull container images from registries.

Here are some basic crictl commands:

  • crictl images: This command lists all the container images available on the node.
  • crictl pull <image name>: This command pulls a container image from a registry.
  • crictl run <image name>: This command starts a container based on the specified image.
  • crictl ps: This command lists all the running containers on the node.
  • crictl stop <container ID>: This command stops the specified container.
  • crictl rm <container ID>: This command removes the specified container.

It’s worth noting that CRI-O is not the same thing as crictl. CRI-O is the container runtime, while crictl is a tool for interacting with CRI-O. Understanding the difference between the two is important for using CRI-O effectively.

In addition to its lightweight and secure architecture, CRI-O also provides features that are specifically designed for Kubernetes, such as support for Kubernetes’ pod sandboxing, resource isolation, and container networking. These features make it easier for engineers to manage and deploy Kubernetes workloads.

Finally, it’s worth mentioning that knowledge of CRI-O is also important for passing the Certified Kubernetes Administrator (CKA) and Certified Kubernetes Security Specialist (CKS) exams. Both exams cover CRI-O as part of their curriculum, so engineers who are preparing for these exams should familiarize themselves with CRI-O and its basic commands.

In conclusion, CRI-O is an essential component of any Kubernetes environment. Its lightweight and secure architecture, combined with its compatibility with Kubernetes, make it an ideal container runtime for DevOps and SRE engineers. Learning CRI-O and its basic commands, such as crictl, is crucial for anyone working with containers in a Kubernetes environment, and is a prerequisite for passing the CKA and CKS exams.

--

--

Matías Salinas
Matías Salinas

No responses yet