How to Install CRI-O on Ubuntu For Kubernetes?

How to Install CRI-O on Ubuntu For Kubernetes
Contents

In this article, I will help you to install CRI-O on Ubuntu for Kubernetes by following the simple steps I have mentioned below.

CRI-O is a lightweight container runtime used with the Kubernetes Container Runtime Interface (CRI).

Avail yourself of the CKA coupon code 2023 to get a discount on the certifications provided by the Linux Foundation.

If you are preparing for Kubernetes, then you need to refer to the CKA exam study guide, which will help you prepare well for the exam.

Here are the steps to install CRI-O on Ubuntu.

Step 1: Update Your System

To begin, you need first to verify that your system is up to date by performing the following commands:

sudo apt update
sudo apt upgrade -y

Step 2: Install Required Packages

Install the important CRI-O packages using this command:

sudo apt install -y software-properties-common
sudo add-apt-repository ppa:projectatomic/ppa
sudo apt update

Step 3: Install CRI-O

Use the command apt-get to install CRI-O

sudo apt install -y cri-o-1.19

You need to replace version 1.19 with your desired one for CRI-O. Use the command apt-cache policy cri-o to check all the available versions available.

Step 4: Start and Enable CRI-O

You need to start the CRI-O service and set it to start automatically on boot:

sudo systemctl start crio
sudo systemctl enable crio

Step 5: Configure Kubernetes to Use CRI-O

To use CRI-O as the container runtime, you need to modify the Kubernetes configuration file. Generally, this is done on each node in your Kubernetes cluster. Add the –container-runtime=remote parameter to the /etc/systemd/system/kubelet.service.d/10-kubeadm.conf file and specify the CRI-O socket:

sudo nano /etc/systemd/system/kubelet.service.d/10-kubeadm.conf

Include the following lines in the file:

Environment="KUBELET_EXTRA_ARGS=--container-runtime=remote --container-runtime-endpoint=/var/run/crio/crio.sock"

It’s time to save the file and exit the text editor.

Step 6: Restart Kubelet

Restart the kubelet service to apply the changes you have made:

sudo systemctl daemon-reload
sudo systemctl restart kubelet

Step 7: Verify Installation

You can check that CRI-O is up and running by running the following command:

sudo crictl info

And now It should display information about CRI-O in the JSON format.

{
  "status": {
    "conditions": [
      {
        "type": "RuntimeReady",
        "status": true,
        "reason": "",
        "message": ""
      },
      {
        "type": "NetworkReady",
        "status": false,
        "reason": "NetworkPluginNotReady",
        "message": "Network plugin returns error: No CNI configuration file in /etc/cni/net.d/. Has your network provider started?"
      }
    ]
  }
}

The CRI-O should be installed successfully and configured on your Ubuntu machine. Now, you can proceed further with configuring your Kubernetes cluster that can be used in CRI-O as the container runtime.

Read the Kubernetes tutorial for beginners guide for more information.

Conclusion

I hope this guide was helpful for you to install CRI-O on Ubuntu for Kubernetes. You can also refer to the official documentation for more details.

Let me know if you have any questions in the comment below.

Explore the DevOps certification from experts and master the automation technology using the Linux Foundation coupon.

Frequently Asked Questions

What is Crio OpenShift?

CRI-O is a community-driven open-source container engine. Its main purpose is to replace Docker as the container engine for Kubernetes implementations like the OpenShift Container Platform.

What is the use of CRI-O?

CRI-O is an open-source project for running Kubernetes containers on Linux operating systems. It is designed specifically for Kubernetes, providing a lightweight and optimized runtime for running containers in a Kubernetes cluster.

What is the difference between CRI and CRI-O?

CRI-O is a high-level container runtime that supports the Kubernetes Container Runtime Interface (CRI). It’s a container alternative. It retrieves container images from registries, manages them on disk, and starts a lower-level runtime to execute container processes. CRI-O is yet another container runtime.

Suggested Tutorials:

Leave a Reply

Your email address will not be published. Required fields are marked *

Share this article

Get Proven Copywriting Tips Straight to Your Inbox

Avail 20% instant discount on a huge training catalog using our special Linux Foundation coupons: UPWRITEZ20