Install CRI-O container runtime on CentOS 8 / CentOS 7

The
You can download this article in PDF format to support us through the following link.

Download the guide as a PDF

turn off
The

The
The

CRI-O is an OCI-based implementation of Kubernetes Container runtime interface (CRI). CRI-O aims to provide an integration path between OCI-compliant runtime and kubelet. In this guide, we will discuss the issue of installing the CRI-O container runtime on CentOS 8 / CentOS 7 Linux systems. The scope of CRI-O is limited to the following functions:

  • Support multiple image formats, including existing Docker image formats
  • Support multiple ways to download images, including trust and image verification
  • Container image management (manage image layer, cover file system, etc.)
  • Container process life cycle management
  • Meet the monitoring and logging required by CRI
  • CRI required resource isolation

CRI-O uses the best variety library in different aspects:

Install CRI-O container runtime on CentOS 8 / CentOS 7

CRI-O and Kubernetes follow the same release cycle and deprecation strategy. For more information, please visit Kubernetes version control documentation. Update the system before installation:

sudo yum -y update

The following are the steps to install CRI-O on a CentOS 8 / CentOS 7 Linux server or workstation computer.

Step 1: Add the CRI-O repository

So if you are running the Kubernetes version 1.17, You will install cri-o1.17.x. We will save this version to a variable. Then add the repository to our system.

Add the repository to CentOS 8:

VERSION=1.17
sudo dnf -y install 'dnf-command(copr)'
sudo dnf -y copr enable rhcontainerbot/container-selinux
sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/CentOS_8/devel:kubic:libcontainers:stable.repo
sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable:cri-o:${VERSION}.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:${VERSION}/CentOS_8/devel:kubic:libcontainers:stable:cri-o:${VERSION}.repo

Add the repository to CentOS 7:

VERSION=1.17
sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/CentOS_7/devel:kubic:libcontainers:stable.repo
sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable:cri-o:${VERSION}.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:${VERSION}/CentOS_7/devel:kubic:libcontainers:stable:cri-o:${VERSION}.repo

Step 2: Install CRI-O container runtime on CentOS 8 / CentOS 7

After adding the repository, use the following command to install the CRI-O container runtime on CentOS 8 / CentOS 7:

sudo yum install cri-o

Agree to install many of the dependencies shown:

Transaction Summary
========================================================================================================================================================
Install  19 Packages
Upgrade   8 Packages

Total download size: 91 M
Is this ok [y/N]: y

The GPG key should also be imported.

......   
Importing GPG key 0x75060AA4:
 Userid     : "devel:kubic OBS Project "
 Fingerprint: 2472 D6D0 D2F6 6AF8 7ABA 8DA3 4D64 3903 7506 0AA4
 From       : http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.17/CentOS_8/repodata/repomd.xml.key
Is this ok [y/N]: y

Confirm to install CRI-O on CentOS:

$ rpm -qi cri-o
Name        : cri-o
Epoch       : 2
Version     : 1.17.2
Release     : 1.2.el8
Architecture: x86_64
Install Date: Tue 21 Apr 2020 03:13:42 PM UTC
Group       : Unspecified
Size        : 171568080
License     : ASL 2.0
Signature   : RSA/SHA256, Tue 14 Apr 2020 03:44:45 AM UTC, Key ID 4d64390375060aa4
Source RPM  : cri-o-1.17.2-1.2.el8.src.rpm
Build Date  : Tue 14 Apr 2020 03:44:06 AM UTC
Build Host  : localhost
Relocations : (not relocatable)
Vendor      : obs://build.opensuse.org/devel:kubic
URL         : https://github.com/cri-o/cri-o
Summary     : Kubernetes Container Runtime Interface for OCI-based containers

Step 3: Start the CRI-O service

By default, the cri-o service is not enabled or started. let’s start:

sudo systemctl enable --now cri-o

In the follow-up guide, we will introduce the use of CRI-O runtime engine to create Kubernetes Cluster and possible ways to interact with cri-o containers. The essential Command line tool.

In the meantime, please check other container related articles on our website.

How to open Shell prompt on OpenShift node

How to install Kubernetes dashboard using NodePort

How to create an admin user to access the Kubernetes dashboard

Top-level minimal container operating system running Kubernetes

The
You can download this article in PDF format to support us through the following link.

Download the guide as a PDF

turn off
The

The
The

Sidebar