Add nix-snapshotter support to the embedded containerd#13676
Open
nuketownada wants to merge 1 commit intok3s-io:mainfrom
Open
Add nix-snapshotter support to the embedded containerd#13676nuketownada wants to merge 1 commit intok3s-io:mainfrom
nuketownada wants to merge 1 commit intok3s-io:mainfrom
Conversation
Add the nix-snapshotter plugin to k3s's embedded containerd, enabling rootless k3s with nix-snapshotter. This follows the same integration pattern as the existing stargz snapshotter. Changes: - Register nix-snapshotter plugin via blank import in builtins_linux.go - Add NixSupported() validation functions for linux and windows - Add "nix" case to snapshotter switch with image service socket config - Add nix snapshotter containerd config blocks in v2 and v3 templates - Set disable_snapshot_annotations = false for nix (required for layer annotations used by nix-snapshotter) Usage: k3s server --snapshotter=nix Revives k3s-io#9319. Co-Authored-By: Joshua Perry <josh@6bit.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Add the nix-snapshotter plugin to k3s's embedded containerd, enabling rootless k3s with nix-snapshotter. This follows the same integration pattern as the existing stargz snapshotter.
Changes:
builtins_linux.goNixSupported()validation functions for linux and windows"nix"case to snapshotter switch with image service socket configdisable_snapshot_annotations = falsefor nix (required for layer annotations)Usage:
k3s server --snapshotter=nixContext
This revives #9319 (closed as stale), updated for k3s 1.34 and containerd v2.
Key differences from the original PR:
config.go→config_linux.go(matching current k3s structure)templates.gonix-snapshotter is a containerd snapshotter that understands nix store paths natively, enabling fully declarative container images built with Nix. See the architecture docs for details on the image service.
Types of Changes
nix-snapshotteras a Go dependency (1 line in go.mod)nixas a valid snapshotter option for the agentnixsnapshotter, configures it as an image serviceTesting
nix build .#k3sproduces working k3s binary with nix-snapshotter linked in🤖 Generated with Claude Code