Kubernetes Blog
Follow
Kubernetes 1.31: Read Only Volumes Based On OCI Artifacts (alpha)
Kubernetes v1.31 introduces Image Volume Source, enabling users to mount OCI-compatible images and artifacts as native volumes in pods. This allows for flexible use cases such as sharing configuration files, packaging binary artifacts, and mounting large language or machine learning model weights.The feature reuses the existing container image implementation in the kubelet, providing a familiar API surface.Users can specify an image reference as a volume in a pod and mount it within containers, separating the content from the executables that process it.Security engineers can mount volumes of private malware signatures into a public malware scanner image, ensuring efficient malware detection.Data scientists and AI developers can mount model weights alongside model-server containers, streamlining model deployment and serving.The feature is initially in alpha, requiring the ImageVolume alpha feature gate to be enabled on the API server and kubelet.Detailed examples illustrate how to create a pod with an image volume and explore its contents.The implementation aligns closely with the existing image pull behavior, including pull policy handling and pull secret assembly.The feature works with the AlwaysPullImages admission plugin and supports mounting OCI objects as read-only, non-executable directories.Sub-path mounts and the spec.securityContext.fsGroupChangePolicy field are not supported with this volume type.