Commit Graph
515 Commits
Author SHA1 Message Date
Derek McGowan fbd9f37c2d docs: document the transform suffix rule
Neither doc previously said how much of a claimed transform chain is
actually honored; a reader could assume claiming any transform in a
chain was sufficient on its own. State the suffix rule plainly, with
the format/mkdir/overlay example the code itself now enforces, and
call out that format in particular can only ever be claimed as part
of a suffix that covers what follows it, never alone, since it
resolves mount points internal to the mount manager.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2026-08-26 10:49:00 -07:00
Derek McGowan aedbd24669 docs: document the shim mount capability
Add a registry entry for the containerd.types.MountCapabilities extension,
and update the mount and bootstrap protocol docs for extensions replacing
the reserved-for-future-use capabilities field, and for the removal of the
runtime-allow-mounts annotation and the "/*" transform convention.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2026-08-26 10:49:00 -07:00
Nahum Litvin a9d5caf7fc metadata: bound snapshotter Remove during garbage collection
The snapshot garbage collector holds the snapshotter write lock while
calling the underlying Snapshotter.Remove. cleanupSnapshotter also
detaches cancellation (context.WithoutCancel), so a Remove that never
returns - e.g. a proxy snapshotter whose RPC connection has wedged -
holds the write lock forever. Every subsequent snapshot operation on
the node then blocks behind the lock, including CRI RunPodSandbox,
turning the node into a permanent scheduling black hole while it still
reports Ready.

Observed in production with a proxy snapshotter (soci) that stopped
answering after a file-descriptor exhaustion storm: the GC goroutine
sat in WaitGroup.Wait for 4.5 hours with the Remove RPC parked in
waitOnHeader, and 17 CRI operations queued behind the metadata lock.

Bound each GC-path Remove with a timeout registered via pkg/timeout
(io.containerd.timeout.gc.snapshotter.remove, default 30m,
operator-tunable through config.toml like the other timeout keys). A
timed-out Remove returns DeadlineExceeded, which is not a
FailedPrecondition, so it propagates out of pruneBranch and ends the
pass: a globally wedged snapshotter costs one timeout per GC cycle
rather than one per orphaned snapshot, the deferred Cleanup is skipped
because the pass failed, and the snapshots left behind stay orphaned
for the next pass.

Signed-off-by: Nahum Litvin <nahuml@wix.com>
2026-08-20 08:56:02 -05:00
Wei Fu 402eb3166e runtime: invoke Shutdown after every task deletion
TaskService.Shutdown may be invoked multiple times. A grouped shim
itself does not terminate while it still has active tasks. It terminates only
after receiving a Shutdown request when no active tasks remain.

The shim manager should invoke TaskService.Shutdown after deleting every task,
regardless of whether the task represents sandbox or not. This ensures that the
shim receives Shutdown when the last active task is deleted.

In CRI, the pause container uses oom_score_adj=-998, making it unlikely to be
OOM-killed. However, it may still exit or be killed before the other containers
in the sandbox. SandboxService.Shutdown and TaskService.Shutdown are independent
APIs. Sandbox service should make sure there is no active containers
before shutdown. So, for the task service, we should invoke Shutdown for
each task.

Removing the supportSandboxAPIVersion check does not change behavior for shims
using task API versions below v3. Those shims were already forced down the
non-sandboxed path and received Shutdown after every task deletion. The behavior
change applies only to sandboxed tasks using task API v3, which now receive
Shutdown after deletion as well.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2026-08-17 18:09:54 -04:00
Maksym Pavlenko 0d21db6bf5 docs: reflow the erofs tar index mode section
Wrap the four long paragraphs at 80 columns to match the rest of the file.
No text changes.

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2026-08-05 20:25:51 -07:00
Maksym Pavlenko a23e4a127a docs: document the erofs layer content cache
Describe layer_content_caches: what it replaces (a mkfs.erofs run per layer
on every node), how a hit is served, how multiple directories are searched,
and how to build a cache with ctr images build-erofs-cache. Call out that the
cached blob is symlinked rather than copied, so entries have to outlive the
snapshots referencing them, and that fsverity and IMMUTABLE_FL can't be used
alongside a cache.

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2026-08-05 20:25:51 -07:00
Samuel Karp fdf814c21a docs/security: update security report triage criteria
Add proof-of-concept (PoC) execution requirements against a running
daemon to the triage guide and threat model.

Assisted-by: Antigravity
Signed-off-by: Samuel Karp <samuelkarp@google.com>
2026-07-29 21:35:42 -07:00
Maksym Pavlenko 820d0f6c0f Merge pull request #13821 from samuelkarp/fix-debug-address-default-doc
docs: correct default for [debug] address
2026-07-22 02:39:41 +00:00
Samuel Karp 1a7d78e0b9 docs: correct default for [debug] address
The debug server plugin returns ErrSkipPlugin when its address is empty
and the default configuration emitted by 'containerd config default'
sets the address to an empty string.

Assisted-by: Claude Code (Opus 4.8)
Signed-off-by: Samuel Karp <samuelkarp@google.com>
2026-07-20 22:39:09 -07:00
Samuel KarpandVinayak Goyal 3a3eddcbf9 docs: add threat model and triage guide
This commit introduces a comprehensive threat model, and security
triage guide, and operator guidelines based on the code, documentation
and a review of the published GitHub Security Advisories (GHSAs)

Assisted-by: gemini-cli
Assisted-by: Antigravity
Assisted-by: Claude Code (Opus 4.8)
Co-authored-by: Vinayak Goyal <vinayakankugoyal@gmail.com>
Signed-off-by: Samuel Karp <samuelkarp@google.com>
2026-07-20 22:13:03 -07:00
Samuel Karp 06495733b2 cri: add enable_criu configuration option
Add a new `enable_criu` configuration option under CRI plugin runtime
settings. When set to false, any checkpoint or restore request will fail
fast with an error indicating that CRIU support is disabled by
configuration. `enable_criu` currently defaults to true.

Add an integration test script to verify that setting `enable_criu` to
false in containerd configuration successfully disables checkpoint and
restore operations and fails fast.

Assisted-by: Antigravity
Signed-off-by: Samuel Karp <samuelkarp@google.com>
2026-06-30 12:47:48 -07:00
Maksym Pavlenko 7e2450af08 Merge pull request #13410 from austinvazquez/fix-runtime-docs-errref
docs: point runtime to updated errdefs pkg
2026-06-29 18:59:25 +00:00
s3onghyun 59ccb0029b docs: fix duplicated word in NRI guide
Signed-off-by: s3onghyun <s3onghyun.hong@gmail.com>
2026-06-18 17:44:26 +09:00
Alex Lyn 8f7c7fb447 cri: skip pause image pull for non-podsandbox sandboxers
The RunPodSandbox unconditionally pre-pulls the pause container
image via ensurePauseImageExists() before starting any sandbox.
However, only the "podsandbox" controller actually uses the pause
image to create a pause container holding namespaces. Shim-based
sandbox controllers (e.g. Kata Containers) manage the sandbox
lifecycle entirely at the shim level and never reference the pause
image.

Add a DisablePauseImagePull flag to the Runtime config that gates
ensurePauseImageExists(). When a sandboxer is not "podsandbox", the
flag skips the unnecessary pre-pull, avoiding wasted network/storage
overhead and reducing sandbox startup latency.

The long-term direction is to offload image pulling entirely to the
controller implementation (shim level); this flag is an incremental
step toward that goal without introducing a breaking behavior change.

Also add unit tests to verify that ensurePauseImageExists is only
invoked for the "podsandbox" sandboxer and correctly skipped otherwise.

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2026-05-27 15:53:27 -05:00
Austin Vazquez 668e0681a4 docs: point runtime to updated errdefs pkg
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2026-05-14 13:24:12 -05:00
Maksym Pavlenko 0a3363b44d Move remote-snapshotter.md to docs/snapshotters
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2026-04-28 12:41:58 -07:00
Mike Brown 99ba3427f8 Merge pull request #13259 from mxpv/sandbox-docs
Document Sandbox API
2026-04-26 14:21:28 +00:00
Fu Wei 46a7bd7acb Merge pull request #12562 from dmcgowan/plugin-api-handlers
Add plugins for server listeners
2026-04-22 17:27:28 +00:00
Derek McGowan 5098311fb1 Update docs for version 4 server plugin configuration
Document the new server plugin configuration blocks for GRPC, TTRPC,
debug, and metrics. Mark the legacy top-level sections as deprecated.
Note that in version 4, the TTRPC plugin is configured independently
from GRPC and uses its own defaults when its plugin block is omitted.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2026-04-21 18:03:10 -07:00
Maksym Pavlenko 54d7c96fb9 Document Sandbox API
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2026-04-20 14:46:50 -07:00
Maksym Pavlenko fcb23002b4 Document shim bootstrap protocol behavior
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2026-04-09 11:58:08 -05:00
Jintao Zhang 22e6e1541c Add binary-v2 logging readiness scheme
Expose log URI schemes in runtime v2 metadata

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
2026-04-05 13:41:15 +00:00
Maksym Pavlenko 169e000389 Move runtime v2 docs to ./docs
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2026-04-04 14:10:29 -07:00
Sergey Kanzhelev 05d3b31586 pause image 3.10.1 -> 3.10.2 for add Windows Server 2025 (ltsc2025) support
Signed-off-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2026-04-03 16:17:39 +00:00
Aadhar Agarwal 50f5461fb7 Add dmverity support to the erofs snapshotter using veritysetup-go
Signed-off-by: Aadhar Agarwal <aadagarwal@microsoft.com>
2026-03-31 20:21:39 +00:00
Sebastiaan van Stijn 6b58f13443 replace some uses of interface{} in (go)docs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-17 13:38:25 +01:00
Gao Xiang 255ed2c183 snapshots/erofs: Update EROFS snapshotter documentation
- The latest benchmark result is now added:
    https://github.com/erofs/erofs-openbenchmark/actions/runs/23042376560

 - Add some useful highlights of EROFS filesystem itself.

Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2026-03-16 22:11:25 +08:00
Sebastiaan van Stijn 3c64bf76d0 docs: fix dupword
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-02-16 20:45:30 +01:00
Andrew Halaney 9b50650d5c snapshots/erofs: Support idmap mounts
This disables the slow_chown feature (nobody in their right mind
is going to be choosing erofs and want to slowly chown each file),
indicates that we support idmaps if the kernel supports it, and makes
sure to chown the upperdir.

This is more or less exactly how the overlay snapshotter does things,
minus the slow_chown part (which has discussions about dropping
altogether at some point anyways).

Signed-off-by: Andrew Halaney <ahalaney@netflix.com>
2026-01-02 10:05:29 -06:00
Akihiro Suda 31594c0638 Merge pull request #12374 from erofs/erofs-snapshotter-fsmerge
Add support for EROFS fsmerge feature
2025-12-30 12:08:18 +00:00
Gao Xiang 9a7500a974 Add support for EROFS fsmerge feature
EROFS has supported a tiny metadata-only image to reference external
blobs since Linux 5.16. This eliminates the need to mount each EROFS
layer one by one and is also useful for VM-based containers (e.g.
nerdbox and Kata containers.)

Similar to LCOW/CimFS, `snapshots.UnpackKeyPrefix` is used to
trigger fsmerge generation (typically < 100 ms) on demand in Prepare().

In the future, we can also generate fsmeta in Commit() of the final
unpacking layer (by introducing an annotation to keep the chainID).
However, in the case of intermediate layer reuse, the Prepare() handling
will still be required.

```toml
[plugins."io.containerd.snapshotter.v1.erofs"]
  max_unmerged_layers = 1      # enable fsmerge if image layers >= 2
```

Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2025-12-29 17:39:09 +08:00
Davanum Srinivas 7e5809bcfe stats_collection_period -> stats_collect_period
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-12-08 16:03:06 -05:00
Davanum Srinivas 9d5ee65014 cri: Add background stats collector to calculate UsageNanoCores
adds a background stats collector that calculates `UsageNanoCores` for containers and pod sandboxes.

- run in the background every second to collect CPU metrics for all containers and sandboxes (similar to what cAdvisor does)
- keep a rolling buffer of CPU samples and calculates the instantaneous CPU usage rate from consecutive samples
- read pod-level CPU stats from the parent cgroup rather than the pause container
- add cgroupv2 Pressure Stall Information for CPU, memory, and IO
- add missing `Timestamp` and `Interfaces` fields

when Kubernetes runs with `PodAndContainerStatsFromCRI=true`, it expects `UsageNanoCores` to be set in stats responses.
This value represents how much CPU is being used right now (as opposed to `UsageCoreNanoSeconds` which is cumulative).
To calculate it, we need to compare CPU samples over time to replicate what is in cadvisor.

we can't yet really test this in CI as some changes in kubernetes has to land for `--feature-gates=PodAndContainerStatsFromCRI=true`

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-12-08 16:03:06 -05:00
Sebastiaan van Stijn 459a95287b core/runtime/v2: remove uses of otelgrpc.UnaryClientInterceptor
The otelgrpc.UnaryClientInterceptor and otelgrpc.StreamClientInterceptor
options were deprecated and removed in favor of NewClientHandler.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-01 14:32:11 +01:00
Gao Xiang 77644a1b01 Update EROFS snapshotter documentation
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2025-11-06 02:55:20 +08:00
Derek McGowan 8ef2cfb7eb Improve documentation for mount manager
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-10-27 22:48:11 -07:00
Derek McGowan 9a43ee660a Merge pull request #6488 from evankanderson/main
Default config_path if legacy registry options are not set.
2025-10-24 01:28:00 +00:00
Akihiro Suda f7e5f7ea4e Merge pull request #12363 from lujinda/update_unprivileged_doc
docs: update default values for unprivileged port and ICMP settings
2025-10-21 02:40:38 +00:00
Evan Anderson 5386802f8a Default config_path if legacy registry options are not set.
Signed-off-by: Evan Anderson <evan.k.anderson@gmail.com>
2025-10-16 17:51:44 -07:00
jinda.ljd fe02fcc5f7 docs: update default values for unprivileged port and ICMP settings
Signed-off-by: lujinda <q8886888@qq.com>
Signed-off-by: jinda.ljd <jinda.ljd@alibaba-inc.com>
2025-10-11 20:45:52 +08:00
Derek McGowan 61b8426ae1 Add mount manager documentation
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-09-29 17:08:36 -07:00
Mike Brown 9aebe599ec Merge pull request #12217 from klihub/devel/main/update-nri
nri: update NRI to v0.10.0.
2025-08-22 17:37:09 +00:00
Krisztian Litkey ad207c1ce3 docs: update docs for NRI v0.10.0.
Added v0.1.0 plugin support to the list of deprecated features in
RELEASES.md. Added a chapter about how to enable and configure the
default validator plugin in NRI.md

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
2025-08-22 13:11:15 +03:00
Akihiro Suda 1321cbc7b6 Merge pull request #12025 from dmcgowan/gc-reverse-ref
Add support for back references in the garbage collector
2025-08-22 04:45:55 +00:00
Divya Rani 37b12bf5e2 Add documentation for cgroup_writable field
Signed-off-by: Divya Rani <ranidivya063@gmail.com>
2025-08-22 07:01:38 +05:30
Akihiro Suda a92d8700bf Merge pull request #12085 from akhilerm/pause-3.10.1
update pause image to pause:3.10.1
2025-07-15 06:12:20 +00:00
Akhil Mohan 222b2d3e72 update pause image to pause:3.10.1
Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
2025-07-11 11:29:02 +05:30
Gao Xiang e96ebc0085 erofs-snapshotter: make IMMUTABLE_FL optional
Enabling the IMMUTABLE_FL file attribute causes dirty data to be
flushed synchronously at least on EXT4, which can greatly impact
container launch performance.  In contrast, the overlayfs snapshotter
does not use syncfs by default.

Most users may not need IMMUTABLE_FL, let's make IMMUTABLE_FL optional
to align with the behavior of the overlayfs snapshotter and recover the
original performance.

1. tensorflow

Test commands:
$ nerdctl image pull --snapshotter=X --unpack="false" tensorflow/tensorflow:2.19.0
$ time nerdctl container --snapshotter=X run -d tensorflow/tensorflow:2.19.0 /bin/sh

Results:
 overlayfs                 | 0m18.748s
 erofs (no IMMUTABLE_FL)   | 0m10.090s
 erofs (with IMMUTABLE_FL) | 0m21.074s

2. ubuntu 22.04

Test commands:
$ nerdctl image pull --snapshotter=X --unpack="false" ubuntu:22.04
$ time nerdctl container --snapshotter=X run -d ubuntu:22.04 /bin/sh

Results:
 overlayfs                 | 0m1.147s
 erofs (no IMMUTABLE_FL)   | 0m0.795s
 erofs (with IMMUTABLE_FL) | 0m1.094s

Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2025-07-11 02:56:37 +08:00
Aadhar Agarwal b641933cfa erofs snapshotter: Add tar index mode
Signed-off-by: Aadhar Agarwal <aadagarwal@microsoft.com>

Minor style updates to erofs.md and differ_linux.go

Signed-off-by: Aadhar Agarwal <aadagarwal@microsoft.com>

Add use case for tar index in erofs.md

Signed-off-by: Aadhar Agarwal <aadagarwal@microsoft.com>
2025-07-08 21:44:49 +00:00
Gao Xiang a0ed14fd48 erofs-differ: fix filesystem UUID for tar-converted layers
Derive filesystem UUIDs (`lsblk -o +UUID`) from the OCI layer digests
(although diffIDs are better in principle, but they're unavailable by
differs in advance) rather than generating a random one.  This allows
EROFS to uniquely identify each layer using the content-addressable
filesystem UUID.

It can also be used for reproducible builds. To achieve this, configure
`mkfs_options` with `-T0 --mkfs-time` (However, `--mkfs-time` requires
erofs-utils 1.8+; Otherwise, all inode timestamps will be reset w/o it):

``` toml
  [plugins."io.containerd.differ.v1.erofs"]
    mkfs_options = ["-T0 --mkfs-time"]
```

Fixes: c73c8e5d52 ("Introduce EROFS differ")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2025-07-02 08:25:50 +08:00