[SIG-Node]: 4216 - Support image pull per runtime class
Author: ChengyuZhu6Created Sep 29, 2026Updated Sep 29, 2026
Labelskind/featurearea/cri
KEP/SIG-Node References
- KEP(s): https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/4216-image-pull-per-runtime-class
- stage: alpha (kubelet feature gate
RuntimeClassInImageCriApi, off by default) - KEP Issue: https://github.com/kubernetes/enhancements/issues/4216
- KEP PR: https://github.com/kubernetes/enhancements/pull/4217
- K8s-Release: 1.29 (alpha). Still alpha / off-by-default as of 1.37; not scheduled for beta.
- KEP-Owner: @kiashok
- SIG-Node member liason: @mikebrow
- KEP-Shepherd: @ChengyuZhu6
- Supersedes: containerd/containerd#9377
What is the SIG-Node problem you are trying to solve
KEP-4216 extends CRI with an optional ImageSpec.runtime_handler so that a runtime identifies an image as a tuple of (imageName/imageDigest, runtimeClass) instead of (imageName/imageDigest). Multiple "variants" of the same image reference can then coexist on one node, selected per runtime handler.
The Kubernetes side is done. CRI has the field, and kubelet has the plumbing behind
RuntimeClassInImageCriApi:
EnsureImageExists()takespodRuntimeHandlerand buildskubecontainer.ImageSpec{Image, Annotations, RuntimeHandler}(pkg/kubelet/images/image_manager.go).- Image GC indexes
imageRecordsby a"<imageID>,<runtimeHandler>"tuple and callsRemoveImage(ctx, container.ImageSpec{Image: id, RuntimeHandler: ...})(pkg/kubelet/images/image_gc_manager.go,getImageTuple()/freeImage()). ListImages()consumesimg.Spec.RuntimeHandler; if a runtime does not populate it, kubelet logsWARNING: RuntimeHandler is emptyand falls back to image-ID-only indexing (pkg/kubelet/kuberuntime/kuberuntime_image.go).
Two concrete user-visible drivers:
- Windows: the platform matcher requires an exact host/guest OS version match, which is wrong for Hyper-V isolated containers whose UVM OS version differs from the host. The pull should match the guest platform configured for the runtime handler instead.
- Snapshotter per runtime class / remote snapshotters: the same image reference pulled under
two runtime classes needs to be unpacked once per snapshotter (for example overlayfs and a
lazy-pulling remote snapshotter). containerd keeps one entry per image, so the second runtime
class is told the image is already present and never gets its own unpack, and
RemoveImagedrops it for every runtime class.
Describe the solution you would like
-
Update cri-api— done, vendored v0.37.1 already hasImageSpec.runtime_handler - Honor
runtime_handlerinPullImage(snapshotter selection works today, platform does not) - Identify images as a tuple of (imageName, runtimeClass) in the CRI image store
- Unpack an image per runtime class / snapshotter
- Report the runtime class in
ListImages/ImageStatus, and scopeRemoveImageto it - Add a runtime class label to containerd images
- Reject unknown runtime handlers
- Update GC so an image is removed only when no runtime class still references it
- Add functional and e2e tests
- Extend
ctr(crictl changes belong to kubernetes-sigs/cri-tools)
Additional context
No response
Source: containerd/containerd