containerd

What Is containerd?

containerd is an open-source, industry-standard container runtime that manages the complete lifecycle of containers on a host system. It is responsible for transferring and storing container images, preparing the filesystem, running and managing containers. containerd does not perform all low-level tasks by itself but cooperates with various components, for example snapshotters and runtimes based on OCI such as runtimes. Given its modular architecture, containerd performs container management separate from container execution methods. containerd is a graduated project of the Cloud Native Computing Foundation (CNCF) and serves as a core component of several container platforms.

How Does containerd Work?

containerd has an API through which it listens for requests for container management. With workload requesting an image from a container registry, the image is downloaded and stored locally. A snapshotter then creates the root filesystem of the container from the image contents. Then containerd generates the container configuration but hands over the execution process to a lower level OCI runtime, which is commonly runc. The runtime shims preserve the communication between containerd and the processes of the running containers which gives the daemon the advantage of managing their lifecycle separately. Containerd is also responsible for managing the cleanup of resources when containers halt or are deleted.

Key Characteristics of containerd

  • Image management: Pulls, stores, and manages container images and their associated content.
  • Container lifecycle management: Handles container creation, execution, supervision, and removal.
  • Snapshotter support: Uses snapshotters such as OverlayFS to prepare and manage container filesystems.
  • OCI runtime integration: Delegates low-level container execution to OCI-compatible runtimes such as runc.
  • Runtime shims: Maintains communication with container processes independently of the main daemon.
  • Modular architecture: Uses plugins for functions such as image management, storage, and Kubernetes integration.
  • Namespace support: Separates containerd resources among logical namespaces within a shared daemon. These namespaces provide administrative separation, not security isolation.

Benefits of containerd

  • Efficient container management: Handles image operations and container execution through a dedicated runtime service.
  • Runtime flexibility: Integrates with different low-level execution runtimes and snapshotter implementations.
  • Reduced operational complexity: Offers a shared runtime foundation for container platforms and orchestration systems.
  • Scalable architecture: Supports large container workloads through modular components and independent runtime processes.

containerd in Cloud Computing

containerd is utilized within worker nodes as a container runtime in cloud-based Kubernetes clusters. Its CRI (Container Runtime Interface) plug-in helps connect the kubelet with the containerd’s runtime and image services. When Kubernetes assigns the Pod on a certain node, the kubelet makes CRI calls to containerd for the preparation of Pod sandbox, pulling or downloading of necessary images and starting of application containers.

Managed services using Kubernetes have followed the use of containerd in workload execution within their underlying compute nodes. This separation of workload scheduling from the execution of containers makes Kubernetes responsible for workload scheduling while relying on containerd for container management. The cloud platform supplies the compute infrastructure, while containerd manages the container lifecycle on each node.