[SIG-Node]: 4216 - 支持按运行时类下载图像
作者: ChengyuZhu6创建于 2026年9月29日更新于 2026年9月29日
标签kind/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.
内容来源: containerd/containerd