Kubernetes 1.36 OCI Volume Source
Use OCI VolumeSource in Kubernetes 1.36 to pull OCI artifacts directly into Pod volumes. No init containers needed for ML models, configs, or data.
π‘ Quick Answer: Kubernetes 1.36 graduates OCI VolumeSource to Stable. You can now natively mount OCI artifacts (ML models, configs, datasets) as Pod volumes without init containers or custom scripts.
The Problem
Before OCI VolumeSource, loading artifacts into Pods required hacky workarounds:
- Init containers that download models or configs before the main container starts
- Custom sidecar scripts pulling data from registries
- Baked-in container images with models embedded (huge images, slow pulls)
- PVC pre-population requiring manual steps
These approaches added complexity, increased startup times, and made deployments brittle.
The Solution
OCI VolumeSource lets you reference any OCI artifact directly as a volume. The kubelet pulls it natively, just like container images.
Mount an OCI Artifact as a Volume
apiVersion: v1
kind: Pod
metadata:
name: ml-inference
spec:
containers:
- name: inference
image: registry.example.com/vllm:v0.8.0
volumeMounts:
- name: model
mountPath: /models/llama
readOnly: true
volumes:
- name: model
image:
reference: registry.example.com/models/llama-3.1-8b:v1.0
pullPolicy: IfNotPresentPull Policies
volumes:
- name: model
image:
reference: registry.example.com/models/llama-3.1-8b:v1.0
pullPolicy: IfNotPresent # Cache locally, pull once
# pullPolicy: Always # Always pull latest
# pullPolicy: Never # Must exist locallyUsing with Private Registries
apiVersion: v1
kind: Pod
metadata:
name: ml-inference
spec:
imagePullSecrets:
- name: registry-credentials
containers:
- name: inference
image: registry.example.com/vllm:v0.8.0
volumeMounts:
- name: model
mountPath: /models
readOnly: true
volumes:
- name: model
image:
reference: registry.example.com/models/mistral-7b:latest
pullPolicy: IfNotPresentPublishing OCI Artifacts
Push models or configs as OCI artifacts using ORAS:
# Install ORAS CLI
brew install oras # or download from oras.land
# Push a model directory as OCI artifact
oras push registry.example.com/models/llama-3.1-8b:v1.0 \
--artifact-type application/vnd.example.ml-model.v1 \
./model-weights/:application/octet-stream
# Push a config bundle
oras push registry.example.com/configs/app-config:v2.0 \
./config.yaml:application/yaml \
./certs/:application/octet-streamMultiple OCI Volumes
apiVersion: v1
kind: Pod
metadata:
name: multi-model-server
spec:
containers:
- name: server
image: registry.example.com/triton:24.05
volumeMounts:
- name: llama-model
mountPath: /models/llama
readOnly: true
- name: embeddings-model
mountPath: /models/embeddings
readOnly: true
- name: tokenizer
mountPath: /models/tokenizer
readOnly: true
volumes:
- name: llama-model
image:
reference: registry.example.com/models/llama-3.1-8b:v1.0
pullPolicy: IfNotPresent
- name: embeddings-model
image:
reference: registry.example.com/models/bge-large:v1.5
pullPolicy: IfNotPresent
- name: tokenizer
image:
reference: registry.example.com/tokenizers/llama:v1.0
pullPolicy: IfNotPresentCommon Issues
ImagePullBackOff on volume
- Cause: Missing
imagePullSecretsfor private registry - Fix: Add pull secret to Pod spec β same as container image pulls
Volume mount empty
- Cause: OCI artifact has no file layers
- Fix: Verify artifact contents with
oras manifest fetch <ref>
Slow Pod startup with large models
- Cause: Multi-GB model pulled on every Pod start
- Fix: Use
pullPolicy: IfNotPresentand pin tags (avoidlatest)
Best Practices
- Pin artifact tags β use
v1.0notlatestfor reproducibility - Use
IfNotPresentβ avoid re-pulling multi-GB models on every restart - Mount as
readOnlyβ OCI volumes should be immutable - Leverage registry caching β use Harbor or registry mirrors near your clusters
- Store models as OCI artifacts β better than baking into container images
- Use ORAS for publishing β standard tooling for OCI artifact management
Key Takeaways
- OCI VolumeSource is GA in Kubernetes 1.36 β no feature gates needed
- Mount OCI artifacts (models, configs, data) directly as Pod volumes
- Eliminates init container hacks for artifact loading
- Uses same pull infrastructure as container images (secrets, caching, mirrors)
- Perfect for ML model deployment β load models without bloating container images

Recommended
Kubernetes Recipes β The Complete Book100+ production-ready patterns with detailed explanations, best practices, and copy-paste YAML. Everything in one place.
Get the Book βLearn by Doing
CopyPasteLearn β Hands-on Cloud & DevOps CoursesMaster Kubernetes, Ansible, Terraform, and MLOps with interactive, copy-paste-run lessons. Start free.
Browse Courses βπ Deepen Your Skills β Hands-on Courses
Courses by CopyPasteLearn.com β Learn IT by Doing
