{"id":1459,"date":"2024-07-15T01:47:40","date_gmt":"2024-07-14T22:47:40","guid":{"rendered":"https:\/\/computingforgeeks.com\/?p=1459"},"modified":"2024-07-15T01:47:46","modified_gmt":"2024-07-14T22:47:46","slug":"install-cri-o-container-runtime-on-debian-linux","status":"publish","type":"post","link":"https:\/\/computingforgeeks.com\/install-cri-o-container-runtime-on-debian-linux\/","title":{"rendered":"Install CRI-O Container Runtime on Debian 12\/11\/10"},"content":{"rendered":"\n<p>In the year 2017, the Kubernetes project introduced to the public its&nbsp;<a href=\"https:\/\/github.com\/kubernetes\/kubernetes\/blob\/242a97307b34076d5d8f5bbeb154fa4d97c9ef1d\/docs\/devel\/container-runtime-interface.md\" target=\"_blank\" rel=\"noreferrer noopener\">Container Runtime Interface<\/a>&nbsp;(CRI). CRI is a plugin interface designed to give kubelet (an agent used to start containers and create pods in Kubernetes cluster) the ability to use different OCI-compliant container runtimes, without modifications on Kubernetes code. The <a href=\"http:\/\/cri-o.io\/\" target=\"_blank\" rel=\"noreferrer noopener\">CRI-O<\/a>&nbsp;project, build from the work of Kubernetes CRI, is a lightweight runtime for Kubernetes.<\/p>\n\n\n\n<p>This short guide has only one intention, to enable you install and use CRI-O Container Runtime on Debian. With CRI-O, you can run containers directly from Kubernetes without a need for any tooling. Provided the container is OCI-compliant, CRI-O will be able to run it. The introduction of CRI significantly reduced the maintenance overhead for the upstream Kubernetes community and all the vendors building solutions on top of the Kubernetes orchestration platform.<\/p>\n\n\n\n<p>Here is an overview picture on how CRI-O works in Kubernetes ecosystem.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1008\" height=\"1024\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2021\/12\/CRI-Overview-1008x1024.png\" alt=\"\" class=\"wp-image-111127\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2021\/12\/CRI-Overview-1008x1024.png 1008w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2021\/12\/CRI-Overview-295x300.png 295w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2021\/12\/CRI-Overview-768x780.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2021\/12\/CRI-Overview-696x707.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2021\/12\/CRI-Overview-1068x1085.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2021\/12\/CRI-Overview-414x420.png 414w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2021\/12\/CRI-Overview.png 1224w\" sizes=\"auto, (max-width: 1008px) 100vw, 1008px\" \/><figcaption class=\"wp-element-caption\">Image source: <a href=\"https:\/\/www.redhat.com\/cms\/managed-files\/CRI-Ov1_Chart_1.png\" target=\"_blank\" rel=\"noreferrer noopener\">redhat<\/a><\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"install-cri-o-container-runtime-on-debian-11-debian-10\">Install CRI-O Container Runtime on Debian<\/h2>\n\n\n\n<p>Follow the steps provided in this guide to have a working setup of <meta charset=\"utf-8\"><\/meta>CRI-O Container Runtime on Debian Linux.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-1-update-debian-system\">Step 1: Update Debian System<\/h3>\n\n\n\n<p>We always start our installations by updating and upgrading the system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update &amp;&amp; sudo apt -y upgrade<\/code><\/pre>\n\n\n\n<p>If the upgrade completes without errors, reboot the system before adding CRI-O APT repository to the system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo reboot<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-2-add-cri-o-kubic-repository-to-debian-system\">Step 2: Add CRI-O repository<\/h3>\n\n\n\n<p>Since the scope for CRI-O is to work with Kubernetes in management and running OCI containers, it is recommended to install the version of CRI-O matching your Kubernetes release. The project provides some user-facing tools for troubleshooting containers on Kubernetes.<\/p>\n\n\n\n<p>Check <a href=\"https:\/\/kubernetes.io\/releases\/\" target=\"_blank\" rel=\"noreferrer noopener\">Kubernetes version<\/a>\u00a0and change version.<a href=\"https:\/\/github.com\/cri-o\/packaging\/blob\/main\/README.md#define-the-kubernetes-version-and-used-cri-o-stream\" rel=\"noopener\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>KUBERNETES_VERSION=v1.30\nCRIO_VERSION=v1.30<\/code><\/pre>\n\n\n\n<p>Adding CRI-O repository on Debian:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"deb &#91;signed-by=\/etc\/apt\/keyrings\/cri-o-apt-keyring.gpg] https:\/\/pkgs.k8s.io\/addons:\/cri-o:\/stable:\/$CRIO_VERSION\/deb\/ \/\" |\n    tee \/etc\/apt\/sources.list.d\/cri-o.list<\/code><\/pre>\n\n\n\n<p>Import GPG key used in packages signing after repository has been added to the system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -fsSL https:\/\/pkgs.k8s.io\/addons:\/cri-o:\/stable:\/$CRIO_VERSION\/deb\/Release.key |\n    gpg --dearmor -o \/etc\/apt\/keyrings\/cri-o-apt-keyring.gpg<\/code><\/pre>\n\n\n\n<p>Test if repo is working <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-3-install-cri-o-on-debian-11-debian-10\">Step 3: Install CRI-O on <meta charset=\"utf-8\"><\/meta>Debian<\/h3>\n\n\n\n<p>Install <meta charset=\"utf-8\"><\/meta>CRI-O on <meta charset=\"utf-8\"><\/meta>Debian using the commands below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install cri-o<\/code><\/pre>\n\n\n\n<p>Accept installation prompt with <strong>y <\/strong>key.<\/p>\n\n\n\n<p>Confirm version installed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\">apt show cri-o<\/mark>\nPackage: cri-o\nVersion: 1.30.3-1.1\nPriority: optional\nSection: admin\nMaintainer: Kubernetes Authors &lt;dev@kubernetes.io>\nInstalled-Size: 73.9 MB\nPre-Depends: systemd\nDepends: systemd-sysv,systemd,iptables\nRecommends: kubernetes-cni\nHomepage: https:\/\/kubernetes.io\nDownload-Size: 19.3 MB\nAPT-Manual-Installed: yes\nAPT-Sources: https:\/\/pkgs.k8s.io\/addons:\/cri-o:\/stable:\/v1.30\/deb  Packages\n..<\/code><\/pre>\n\n\n\n<p>Now that CRI-O is installed on our Debian system, let&#8217;s proceed to start the daemon service.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start crio.service<\/code><\/pre>\n\n\n\n<p>Service has to be enabled for automatic start when the system is rebooted.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-pale-pink-color\">sudo systemctl enable crio.service<\/span>\nCreated symlink \/etc\/systemd\/system\/cri-o.service \u2192 \/lib\/systemd\/system\/crio.service.\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/crio.service \u2192 \/lib\/systemd\/system\/crio.service.<\/code><\/pre>\n\n\n\n<p>Service status checking:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-pale-pink-color\">systemctl status crio<\/span>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">\u25cf<\/mark> crio.service - Container Runtime Interface for OCI (CRI-O)\n     Loaded: loaded (\/lib\/systemd\/system\/crio.service; enabled; preset: enabled)\n     Active: <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">active (running)<\/mark> since Thu 2024-07-11 23:25:39 UTC; 8s ago\n       Docs: https:\/\/github.com\/cri-o\/cri-o\n   Main PID: 1628 (crio)\n      Tasks: 8\n     Memory: 14.0M\n        CPU: 195ms\n     CGroup: \/system.slice\/crio.service\n             \u2514\u25001628 \/usr\/bin\/crio\n\nJul 11 23:25:39 deb12 crio&#91;1628]: time=\"2024-07-11 23:25:39.852658644Z\" level=info msg=\"Restore irqbalance config: failed to get current CPU ban list, ignoring\"\nJul 11 23:25:39 deb12 crio&#91;1628]: time=\"2024-07-11 23:25:39.878133563Z\" level=warning msg=\"Error encountered when checking whether cri-o should wipe containers: open \/var\/run\/crio\/version: no such >\nJul 11 23:25:39 deb12 crio&#91;1628]: time=\"2024-07-11 23:25:39.878800355Z\" level=info msg=\"Registered SIGHUP reload watcher\"\nJul 11 23:25:39 deb12 crio&#91;1628]: time=\"2024-07-11 23:25:39.878843428Z\" level=info msg=\"Starting seccomp notifier watcher\"\nJul 11 23:25:39 deb12 crio&#91;1628]: time=\"2024-07-11 23:25:39.878928453Z\" level=info msg=\"Create NRI interface\"\nJul 11 23:25:39 deb12 crio&#91;1628]: time=\"2024-07-11 23:25:39.879168526Z\" level=info msg=\"runtime interface created\"\nJul 11 23:25:39 deb12 crio&#91;1628]: time=\"2024-07-11 23:25:39.879213717Z\" level=info msg=\"Registered domain \\\"k8s.io\\\" with NRI\"\nJul 11 23:25:39 deb12 crio&#91;1628]: time=\"2024-07-11 23:25:39.879235698Z\" level=info msg=\"runtime interface starting up...\"\nJul 11 23:25:39 deb12 crio&#91;1628]: time=\"2024-07-11 23:25:39.879256992Z\" level=info msg=\"starting plugins...\"\nJul 11 23:25:39 deb12 systemd&#91;1]: Started crio.service - Container Runtime Interface for OCI (CRI-O).<\/code><\/pre>\n\n\n\n<p>Install&nbsp;<a href=\"https:\/\/github.com\/kubernetes-sigs\/cri-tools\/releases\" target=\"_blank\" rel=\"noreferrer noopener\">crictl<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>VERSION=$(curl -s https:\/\/api.github.com\/repos\/kubernetes-sigs\/cri-tools\/releases\/latest | grep -oP '\"tag_name\": \"\\K(.*)(?=\")')\ncurl -L https:\/\/github.com\/kubernetes-sigs\/cri-tools\/releases\/download\/$VERSION\/crictl-${VERSION}-linux-amd64.tar.gz --output crictl-${VERSION}-linux-amd64.tar.gz\nsudo tar zxvf crictl-$VERSION-linux-amd64.tar.gz -C \/usr\/local\/bin\nsudo chmod +x \/usr\/local\/bin\/crictl\nrm -f crictl-$VERSION-linux-amd64.tar.gz<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-4-using-cri-o-on-debian-11-debian\">Step 4: Using CRI-O on Debian<\/h3>\n\n\n\n<p>As stated earlier, CRI-O is intended for use with Kubernetes as container runtime that kubelet speaks to in fulfilling the creation, deletion and general lifecycle management of containers.<\/p>\n\n\n\n<p>Check existence of <em>crictl<\/em> command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-pale-pink-color\">sudo crictl info<\/span>\n{\n  \"status\": {\n    \"conditions\": &#91;\n      {\n        \"type\": \"RuntimeReady\",\n        \"status\": true,\n        \"reason\": \"\",\n        \"message\": \"\"\n      },\n      {\n        \"type\": \"NetworkReady\",\n        \"status\": false,\n        \"reason\": \"NetworkPluginNotReady\",\n        \"message\": \"Network plugin returns error: no CNI configuration file in \/etc\/cni\/net.d\/. Has your network provider started?\"\n      }\n    ]\n  },\n  \"runtimeHandlers\": &#91;\n    {\n      \"name\": \"runc\",\n      \"features\": {\n        \"recursive_read_only_mounts\": true\n      }\n    },\n    {\n      \"name\": \"crun\",\n      \"features\": {\n        \"recursive_read_only_mounts\": true,\n        \"user_namespaces\": true\n      }\n    },\n    {\n      \"features\": {\n        \"recursive_read_only_mounts\": true,\n        \"user_namespaces\": true\n      }\n    }\n  ],\n  \"config\": {\n    \"sandboxImage\": \"registry.k8s.io\/pause:3.9\"\n  }\n}<\/code><\/pre>\n\n\n\n<p>We can pull a test image using crictl command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-luminous-vivid-amber-color\">sudo crictl pull hello-world<\/span>\nImage is up to date for docker.io\/library\/hello-world@sha256:1408fec50309afee38f3535383f5b09419e6dc0925bc69891e79d84cc4cdcec6\n\n$ <span class=\"has-inline-color has-luminous-vivid-amber-color\">sudo crictl pull busybox<\/span>\nImage is up to date for docker.io\/library\/busybox@sha256:50e44504ea4f19f141118a8a8868e6c5bb9856efa33f2183f5ccea7ac62aacc9<\/code><\/pre>\n\n\n\n<p>List available images:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-pale-pink-color\">sudo crictl images<\/span>\nIMAGE                           TAG                 IMAGE ID            SIZE\ndocker.io\/library\/busybox       latest              ffe9d497c3241       1.46MB\ndocker.io\/library\/hello-world   latest              feb5d9fea6a5e       19.9kB<\/code><\/pre>\n\n\n\n<p>Your next task is deployment of Kubernetes on Debian Linux system using CRI-O runtime.<\/p>\n\n\n\n<p>We have more guides on Kubernetes administration, some are shared in the links below:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/computingforgeeks.com\/install-nginx-ingress-controller-on-kubernetes-using-helm-chart\/\" target=\"_blank\" rel=\"noreferrer noopener\">Deploy Nginx Ingress Controller on Kubernetes using Helm Chart<\/a><\/li>\n<\/ul>\n\n\n\n<p>For installation of CRI-O on CentOS Linux, refer to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/computingforgeeks.com\/install-cri-o-container-runtime-on-centos-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install CRI-O Container Runtime on CentOS Linux<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/computingforgeeks.com\/install-kubernetes-cluster-on-rocky-linux-with-kubeadm-crio\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install Kubernetes Cluster on Rocky Linux 8 with Kubeadm &amp; CRI-O<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/computingforgeeks.com\/k0s-vs-k3s-vs-microk8s-kubernetes-distributions-comparison\/\" target=\"_blank\" rel=\"noreferrer noopener\">k0s vs k3s vs microk8s Kubernetes Distributions Comparison<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/computingforgeeks.com\/jenkins-multiple-kubernetes-clusters\/\" target=\"_blank\" rel=\"noreferrer noopener\">How To Add Multiple Kubernetes Clusters to Jenkins<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/computingforgeeks.com\/setup-prometheus-and-grafana-on-kubernetes\/\" target=\"_blank\" rel=\"noreferrer noopener\">Setup Prometheus and Grafana on Kubernetes using prometheus-operator<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In the year 2017, the Kubernetes project introduced to the public its&nbsp;Container Runtime Interface&nbsp;(CRI). CRI is a plugin interface designed to give kubelet (an agent used to start containers and create pods in Kubernetes cluster) the ability to use different OCI-compliant container runtimes, without modifications on Kubernetes code. The CRI-O&nbsp;project, build from the work of &#8230; <a title=\"Install CRI-O Container Runtime on Debian 12\/11\/10\" class=\"read-more\" href=\"https:\/\/computingforgeeks.com\/install-cri-o-container-runtime-on-debian-linux\/\" aria-label=\"Read more about Install CRI-O Container Runtime on Debian 12\/11\/10\">Read more<\/a><\/p>\n","protected":false},"author":7,"featured_media":111127,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[316,26,299,317,50],"tags":[218,36475,36477,36476,36478,36480,36479,318],"class_list":["post-1459","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-containers","category-debian","category-how-to","category-kubernetes","category-linux-tutorials","tag-containers","tag-cri-o-container-runtime-on-debian","tag-cri-o-container-runtime-on-debian-10","tag-cri-o-container-runtime-on-debian-11","tag-cri-o-on-debian","tag-cri-o-on-debian-10","tag-cri-o-on-debian-11","tag-kubernetes"],"_links":{"self":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/1459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/comments?post=1459"}],"version-history":[{"count":0,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/1459\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media\/111127"}],"wp:attachment":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media?parent=1459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/categories?post=1459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/tags?post=1459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}