Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Kserve Kserve Storage Credentials

From Leeroopedia
Knowledge Sources
Domains MLOps, Security, Cloud_Storage
Last Updated 2026-02-13 00:00 GMT

Overview

A credential management pattern that securely binds cloud storage access tokens to Kubernetes workloads via Secrets and ServiceAccounts.

Description

Machine learning inference services require access to model artifacts stored in cloud object stores (S3, GCS, Azure Blob) or model registries (HuggingFace Hub). Storage Credentials is the pattern of encapsulating access keys, tokens, and endpoint configuration into Kubernetes Secrets, then associating those Secrets with ServiceAccounts that are referenced by inference workloads.

This pattern solves the fundamental problem of credential injection in containerized ML serving: models must be downloaded at pod startup, but credentials must not be baked into container images. By leveraging Kubernetes-native Secret and ServiceAccount resources with KServe-specific annotations, the storage initializer init-container can discover and use credentials automatically.

Usage

Use this principle whenever deploying an InferenceService that loads model artifacts from a remote storage backend. It is required for:

  • S3-compatible storage (AWS S3, MinIO)
  • Google Cloud Storage (GCS)
  • Azure Blob Storage
  • HuggingFace Hub (private or gated models)

The credentials pattern is not needed for models embedded in container images or pre-loaded on PersistentVolumeClaims with existing data.

Theoretical Basis

The credential injection follows a three-layer binding:

# Abstract credential flow (NOT implementation code)
1. User creates Secret with storage-specific annotations
2. ServiceAccount references the Secret
3. InferenceService references the ServiceAccount
4. Storage initializer reads credentials from mounted Secret
5. Model artifacts are downloaded using credentials

KServe supports two credential discovery mechanisms:

  • Annotation-based: ServiceAccount annotations like serving.kserve.io/s3-endpoint configure the storage client.
  • storageSpecSecretName: A centralized storage-config Secret referenced via the InferenceService ConfigMap.

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment