Implementation:Kserve Kserve ClusterStorageContainer CRD
| Knowledge Sources | |
|---|---|
| Domains | Kubernetes, CRD, Storage Initialization |
| Last Updated | 2026-02-13 00:00 GMT |
Overview
Concrete CRD definition for the ClusterStorageContainer custom resource in the KServe serving API.
Description
This file contains the full CustomResourceDefinition for the ClusterStorageContainer kind, produced by controller-gen v0.19.0. It belongs to the serving.kserve.io API group at version v1alpha1 and is a cluster-scoped resource. The CRD defines storage initializer container configurations for downloading models from various storage backends (e.g., S3, GCS, Azure Blob). Each resource specifies a container definition along with URI format patterns that determine which storage URIs this initializer handles.
Usage
Apply this CRD during KServe installation to register the ClusterStorageContainer API with the Kubernetes API server. Cluster administrators then create ClusterStorageContainer resources to register custom storage initializer containers that handle model downloads from specific storage providers, extending the default storage initialization capabilities.
Code Reference
Source Location
- Repository: Kserve_Kserve
- File: config/crd/full/serving.kserve.io_clusterstoragecontainers.yaml
- Lines: 1-772
Signature
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.0
name: clusterstoragecontainers.serving.kserve.io
spec:
group: serving.kserve.io
names:
kind: ClusterStorageContainer
listKind: ClusterStorageContainerList
plural: clusterstoragecontainers
singular: clusterstoragecontainer
scope: Cluster
versions:
- name: v1alpha1
Import
kubectl apply -f config/crd/full/serving.kserve.io_clusterstoragecontainers.yaml
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| apiVersion | string | Yes | Must be serving.kserve.io/v1alpha1
|
| kind | string | Yes | Must be ClusterStorageContainer
|
| metadata | ObjectMeta | Yes | Standard Kubernetes object metadata (no namespace since cluster-scoped) |
| disabled | boolean | No | Top-level field to disable this storage container without deleting the resource |
| spec | ClusterStorageContainerSpec | Yes | Storage container specification |
Key spec fields:
| Field | Type | Required | Description |
|---|---|---|---|
| spec.container | Container | Yes | Full Kubernetes container definition (name, image, command, args, env, resources, volumeMounts, workingDir) for the storage initializer |
| spec.supportedUriFormats | []UriFormat | Yes | List of URI format patterns (prefix and/or regex) that this container handles for model downloads |
| spec.supportsMultiModelDownload | boolean | No | Whether this container supports downloading multiple models in a single invocation (default: false) |
| spec.workloadType | string | No | Type of workload (default: initContainer); determines how the container is injected into the pod
|
Outputs
| Name | Type | Description |
|---|---|---|
| (none) | -- | This CRD does not define a status subresource; it is a pure configuration resource |
Usage Examples
Create a ClusterStorageContainer
apiVersion: serving.kserve.io/v1alpha1
kind: ClusterStorageContainer
metadata:
name: custom-s3-initializer
disabled: false
spec:
container:
name: storage-initializer
image: myregistry/s3-initializer:v1.0
command:
- /storage-initializer
args:
- --source=$(SOURCE_URI)
- --destination=/mnt/models
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: "1"
memory: 1Gi
supportedUriFormats:
- prefix: s3://
- regex: "https://s3\\..*\\.amazonaws\\.com/.*"
Related Pages
- Kserve_Kserve_Storage_Credentials_Pattern -- Credential injection pattern used alongside storage containers
- Kserve_Kserve_PVC_Storage_Initializer -- PVC-based storage initializer implementation
- New principle needed:
Kserve_Kserve_ClusterStorageContainer_Specification