docs/historical/design/architecture.md
To ensure clean separation of concerns, we have organized the units of containerd's behavior into components. Components are roughly organized into subsystems. Components that bridge subsystems may be referred to as modules. Modules typically provide cross-cutting functionality, such as persistent storage or event distribution. Understanding these components and their relationships is key to modifying and extending the system.
This document will cover very high-level interaction. For details on each module, please see the relevant design document.
The main goal of this architecture is to coordinate the creation and execution of bundles. Bundles contain configuration, metadata and root filesystem data and are consumed by the runtime. A bundle is the on-disk representation of a runtime container. Bundles are mutable and can be passed to other systems for modification or packed up and distributed. In practice, it is simply a directory on the filesystem.
Note that while these architectural ideas are important to understand the system, code layout may not reflect the exact architecture. These ideas should be used as a guide for placing functionality and behavior and understanding the thought behind the design.
External users interact with services, made available via a GRPC API.
Typically, each subsystem will have one or more related controller components that implement the behavior of the subsystem. The behavior of the subsystem may be exported for access via corresponding services.
In addition to the subsystems, we have several components that may cross subsystem boundaries, referenced to as components. We have the following components:
Some components are implemented on the client side for flexibility:
As discussed above, the concept of a bundle is central to containerd. Below is a diagram illustrating the data flow for bundle creation.
Let's take pulling an image as a demonstrated example: