CNCF team has voted to accept CRI-O as an incubation-level hosted project. CRI-O was created by Red Hat and it is an implementation of the Kubernetes Container Runtime Interface (CRI) designed to enable the use of Open Container Initiative (OCI) compatible runtime. In this article, let us look at key features/components, how to configure kubeadm for CRI-O container runtime and deploy apps.
Container runtime is the software that is responsible for running containers. To understand better, let us look at the typical Kubernetes cluster, its comprised of master nodes and a set of slave nodes.
To learn about some of alternative container runtimes, check out here. The Kubernetes master includes the following main components:
In each Kubernetes node following components are available:
iptable
rules for doing simple TCP, UDP stream forwarding or round robin TCP, UDP forwarding.By default, Docker is the container runtime but Kubernetes provides support for multiple container runtimes. The Open Container Initiative (OCI) is a Linux Foundation effort to create a truly portable software container. To standardize container formats and runtimes, OCI published the runtime-spec as a standard for container runtimes.
If you’re looking for quickstart on basic understanding of Kubernetes concepts, please refer earlier posts for understanding on Kubernetes & how to create, deploy & rollout updates to the cluster.
Quick Snapshot
As explained earlier, CRI-O is an implementation of the Kubernetes CRI (Container Runtime Interface) to enable using OCI (Open Container Initiative) compatible runtimes.
CRI-O is a lightweight alternative to Docker as the runtime for Kubernetes. It also allows Kubernetes to use any OCI-compliant runtime as the container runtime for running pods.
kublet
forwards the request to the CRI-O daemon via Kubernetes CRI (Container runtime interface) to launch the new pod.containers/image
library to pull the image from a container registry.runc
for now.conmon
process.Next section, we can check how to install and launch pods, containers.
For Ubuntu, use the following commands to install CRI-O runtime on the nodes.
# Install prerequisites
apt-get update
apt-get install software-properties-common
add-apt-repository ppa:projectatomic/ppa
apt-get update
# Install CRI-O
apt-get install cri-o-1.11
Once CRI-O is installed, use systemctl start crio
to start the daemon
Image – CRI-O Daemon status
kubeadm solves the problem of handling TLS encryption configuration, deploying the core Kubernetes components, and ensuring that additional nodes can easily join the cluster.
More details on Kubeadm can be found at https://github.com/kubernetes/kubeadm
Use the below command to initialize the cluster:
kubeadm init --cri-socket=/var/run/crio/crio.sock --kubernetes-version $(kubeadm version -o short)
Kubernetes cluster has now been initialized. The Master node will manage the cluster and one of the worker nodes will run our container workloads.
Use the below command to copy the configuration to the users home directory and sets the environment variable for use with the CLI.
sudo cp /etc/kubernetes/admin.conf $HOME/ sudo chown $(id -u):$(id -g) $HOME/admin.conf export KUBECONFIG=$HOME/admin.conf
Once the environment variables are configured,Kubernetes CLI kubectl
would now be able to use the configuration to access the cluster.
Like docker ps
command,you can now use crictl ps
to list all the containers. crictl
provides a CLI for CRI-compatible container runtimes.
crictl images
command would list all the images.
For deploying applications to your pod, images need to be prefixed with the Container Image Registry, such as docker.io
for the Docker Hub.
kubectl run http --image=docker.io/docker-http-server:latest --replicas=1
The rest of the steps would be the same, as you have for any Kubernetes deployment. Please refer to earlier posts for understanding on Kubernetes & how to create, deploy & rollout updates to the cluster.
Congrats! today we have learned how to configure and run pods, containers using CRI-O runtime. Do check out OCI Runtime specification, Image specification to learn more about the Open Container initiative.
Like this post? Don’t forget to share it!
In today's digital-first world, businesses must adopt effective strategies to stay competitive. Social media marketing…
62% of UX designers now use AI to enhance their workflows. Artificial intelligence (AI) rapidly…
The integration of artificial intelligence into graphic design through tools like Adobe Photoshop can save…
The cryptocurrency trading world has grown significantly in recent years, with automation playing a key…
The non-fungible token (NFT) market has witnessed explosive growth over the past few years, transforming…
There are few things as valuable to a business as well-designed software. Organizations today rely…
This website uses cookies.