Skip to content

containerd: advertise remap-ids capability for soci proxy plugin#939

Merged
ginglis13 merged 1 commit into
bottlerocket-os:developfrom
mhulscher:soci-remap-ids-capability
Jun 16, 2026
Merged

containerd: advertise remap-ids capability for soci proxy plugin#939
ginglis13 merged 1 commit into
bottlerocket-os:developfrom
mhulscher:soci-remap-ids-capability

Conversation

@mhulscher

Copy link
Copy Markdown
Contributor

Issue number:

Closes bottlerocket-os/bottlerocket#4854

Description of changes:

Add the remap-ids capability to the soci snapshotter configuration, allowing it to start pods with hostUsers: false

Testing done:

Simple manual configuration change on running node (adding the line) and restarting containerd. Let's see what CI says :)

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

The soci proxy_plugins block does not declare the remap-ids
capability, so containerd's resolveSnapshotOptions does not recognize
the snapshotter as supporting ID remapping. For pods with user
namespaces (hostUsers: false) containerd falls back to slow-chown
remapping, then soci's mount callback remaps the already-remapped host
UIDs, and the sandbox fails with "container ID cannot be mapped to a
host ID".

Declaring capabilities = ["remap-ids"] lets containerd pass the idmap
labels and skip slow chown, allowing user-namespace pods to start.

Related: awslabs/soci-snapshotter#1888

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ginglis13

Copy link
Copy Markdown
Contributor

@mhulscher thanks for the contribution. I've tested on my end, LGTM

Built an aws-k8s-1.34 (x86_64), built from core-kit develop with this PR's change applied. User data of the instance:

[settings.container-runtime]
snapshotter = "soci"

[settings.kernel.sysctl]
"user.max_user_namespaces" = "65536"

Confirmed the containerd config on the node includes the fix:

# /etc/containerd/config.d/001-snapshotter.toml
[proxy_plugins.soci]
capabilities = ["remap-ids"]
type = "snapshot"
address = "/run/soci-snapshotter/soci-snapshotter.sock"

Test pod setting hostUsers: false:

apiVersion: v1
kind: Pod
metadata:
  name: userns-soci-test
spec:
  hostUsers: false
  containers:
  - name: test
    image: public.ecr.aws/amazonlinux/amazonlinux:2023
    command: ["sleep", "300"]

Pod started successfully with no errors:

Events:
  Normal  Scheduled  default-scheduler  Successfully assigned default/userns-soci-test to ip-192-168-11-22.us-west-2.compute.internal
  Normal  Pulled     kubelet            Container image "public.ecr.aws/amazonlinux/amazonlinux:2023" already present on machine
  Normal  Created    kubelet            Created container: test
  Normal  Started    kubelet            Started container test

User namespace mapping confirmed active inside the container:

$ id
uid=0(root) gid=0(root) groups=0(root)

$ cat /proc/self/uid_map
 0  782499840      65536

No container ID cannot be mapped to a host ID error observed

@jpculp jpculp requested review from ginglis13 and jpculp June 15, 2026 23:39
@ginglis13 ginglis13 merged commit 95a0efc into bottlerocket-os:develop Jun 16, 2026
2 checks passed
@mhulscher mhulscher deleted the soci-remap-ids-capability branch June 18, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User namespaces don't work w/ SOCI snapshotter

3 participants