Kubernetes Container Runtime Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(12 intermediate revisions by the same user not shown)
Line 3: Line 3:
* https://kubernetes.io/blog/2016/12/container-runtime-interface-cri-in-kubernetes/
* https://kubernetes.io/blog/2016/12/container-runtime-interface-cri-in-kubernetes/
* https://kubernetes.io/docs/setup/production-environment/container-runtimes/
* https://kubernetes.io/docs/setup/production-environment/container-runtimes/
* https://kubernetes.io/blog/2020/12/02/dont-panic-kubernetes-and-docker/


=Internal=
=Internal=


* [[Kubernetes Concepts#Container_Runtime|Kubernetes Concepts]]
* [[Kubernetes Concepts#Subjects|Kubernetes Concepts]]
* [[Docker Concepts]]
* [[Docker Concepts]]
* [[containerd]]
* [[containerd]]
Line 13: Line 14:


=<span id='CRI'></span>Container Runtime Interface (CRI)=
=<span id='CRI'></span>Container Runtime Interface (CRI)=
The Container Runtime Interface (CRI) is an abstraction layer that standardizes the way third-party container runtimes interface with Kubernetes. Irrespective of the container runtime in use, the regular Kubernetes commands and patterns apply. CRI exposes a clean documented interface for third-party container runtimes to plug in to.
The Container Runtime Interface (CRI) is an abstraction layer that standardizes the way third-party container runtimes interface with Kubernetes. Irrespective of the container runtime in use ([[#Docker|Docker]], [[#containerd|containerd]], [[#CRI-O|CRI-O]], the regular Kubernetes commands and patterns apply. CRI exposes a clean documented interface for third-party container runtimes to plug in to.  
 
==Container Runtime Interface and Container Metrics==
Among other functions, CRI exposes container [[Metrics_in_Kubernetes#Resource_Metrics|resource metrics]] to the [[Kubelet#Metrics_Collection|kubelet]]. <font color=darkgray>TODO: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/cri-container-stats.md</font>
{{External|https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/cri-container-stats.md}}
Among other functions, CRI exposes container [[Metrics_in_Kubernetes#Resource_Metrics|resource metrics]] to the [[Kubelet#Metrics_Collection|kubelet]].


=Container Runtime=
=Container Runtime=


Each Kubernetes [[Kubernetes_Control_Plane_and_Data_Plane_Concepts#Container_Runtime|node]] runs a container runtime, usually Docker. However, support for other container runtimes is available, via [[#CRI|Container Runtime Interface (CRI)]]. A container runtime performs container-related tasks such as pulling images and starting and stopping containers.
Each Kubernetes [[Kubernetes_Control_Plane_and_Data_Plane_Concepts#Container_Runtime|node]] runs a container runtime, usually Docker. However, support for other container runtimes is available, via [[#CRI|Container Runtime Interface (CRI)]]. The [[Kubelet#Overview|kubelet]] gets work (pod) assignments from the control plane but delegates the job of running the containers to the container runtime. A container runtime performs container-related tasks such as [[Kubernetes_Container_Image_Pull_Concepts#Overview|pulling images]] and starting and stopping containers.
 
==Available Container Runtimes==


==<span id='Available_Container_Runtimes'></span>Container Runtimes==
===Docker===
===Docker===
 
Kubernetes and Docker are complementary technologies. Docker is the technology that starts and stops containers under Kubernetes' supervision. Kubernetes is the higher-level technology that decides which nodes to run containers on, when to scale an application up or down or when to apply updates. Docker can run without Kubernetes and Kubernetes can run without Docker.
Kubernetes and Docker are complementary technologies. Docker is the technology that starts and stops containers under Kubernetes' supervision. Kubernetes is the higher-level technology that decides which nodes to run containers on, when to scale an application up or down or when to apply updates.
{{Internal|Docker|Docker}}
{{Internal|Docker|Docker}}


Line 31: Line 31:


A container runtime that consists in a stripped-down version of Docker. More details: {{Internal|containerd|containerd}}
A container runtime that consists in a stripped-down version of Docker. More details: {{Internal|containerd|containerd}}
[[AKS_Concepts#Container_Runtime|AKS]] clusters based on Kubernetes 1.19+ use containerd as their container runtime.


====cri-containerd====
====cri-containerd====

Latest revision as of 00:45, 16 November 2021

External

Internal

Container Runtime Interface (CRI)

The Container Runtime Interface (CRI) is an abstraction layer that standardizes the way third-party container runtimes interface with Kubernetes. Irrespective of the container runtime in use (Docker, containerd, CRI-O, the regular Kubernetes commands and patterns apply. CRI exposes a clean documented interface for third-party container runtimes to plug in to.

Container Runtime Interface and Container Metrics

https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/cri-container-stats.md

Among other functions, CRI exposes container resource metrics to the kubelet.

Container Runtime

Each Kubernetes node runs a container runtime, usually Docker. However, support for other container runtimes is available, via Container Runtime Interface (CRI). The kubelet gets work (pod) assignments from the control plane but delegates the job of running the containers to the container runtime. A container runtime performs container-related tasks such as pulling images and starting and stopping containers.

Container Runtimes

Docker

Kubernetes and Docker are complementary technologies. Docker is the technology that starts and stops containers under Kubernetes' supervision. Kubernetes is the higher-level technology that decides which nodes to run containers on, when to scale an application up or down or when to apply updates. Docker can run without Kubernetes and Kubernetes can run without Docker.

Docker

containerd

A container runtime that consists in a stripped-down version of Docker. More details:

containerd

AKS clusters based on Kubernetes 1.19+ use containerd as their container runtime.

cri-containerd

A community-based Open Source port of containerd.

CRI-O

CRI-O

Runtime Classes

Runtime classes is a feature that was introduced in Kubernetes 1.2. It allows for different classes of runtimes (gVisor, Kata Containers, etc).