Getting Started with Kubernetes | Kubernetes Container Runtime Interface

CRI Introduction

Docker was the first container runtime before the CRI was introduced in Kubernetes 1.5. Kubelet performs operations on containers by using Docker APIs through the built-in dockershim, producing final state-oriented results. rkt was another container runtime that was developed after Docker. rkt was incorporated into the Kubelet code so that it is supported by Kubernetes. Containing both Docker and rkt, the Kubernetes code is becoming increasingly complex and difficult to maintain. Then, hyber.sh joined the community and wanted to become the third container runtime.

CRI Implementation

CRI

  • The streaming server provides streaming data interfaces such as exec and port-forward.

Container Lifecycle Management Through the CRI

  • Kubelet calls the CreatContainer interface to create a business container in the pod container space.
  • Kubelet calls the StartContainer interface to start the container. The interfaces used to destroy containers are StopContainer and RemoveContainer.

CRI Streaming Interface

This section describes the exec streaming interface of the CRI. The exec interface is used to run a command in a container and can be attached to the container’s I/O stream to run interactive commands. The exec interface reduces resource use and ensures a stable connection.

CRI Implementations

The current CRI implementations include:

  • CRI-O
  • PouchContainer @alibaba

CRI-containerd

The following figure shows the CRI-containerd architecture.

CRI-O

The following figure shows the implementation of CRI-O.

Related Tools

This section describes CRI-related tools. These tools can all be found in this project.

FAQ

Question 1: Is it possible to improve the CRI specification of the v1 alpha2 version?

Summary

Let’s summarize what we have learned in this article.

  • CRI implementations include CRI-O and CRI-containerd.
  • cri-tools are used for CRI debugging, and critest is used for CRI testing.

Original Source:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store