Implementation:Kserve Kserve GPU Cluster Credentials
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, GPU_Computing, Security |
| Last Updated | 2026-02-13 00:00 GMT |
Overview
Concrete YAML pattern for creating HuggingFace credentials and verifying GPU availability for LLM inference workloads.
Description
This pattern creates the credential resources required by LLMInferenceService for downloading gated or private models from HuggingFace Hub. The Secret stores the HF token, and the ServiceAccount is referenced by the LLMInferenceService spec.
Usage
Apply these credentials before deploying an LLMInferenceService that references an hf:// model URI.
Code Reference
Source Location
- Repository: kserve
- File: docs/samples/storage/hf/hf_secret.yaml, Lines 1-14
Signature
apiVersion: v1
kind: Secret
metadata:
name: storage-config
type: Opaque
stringData:
HF_TOKEN: <your-huggingface-token>
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: hfserviceacc
secrets:
- name: storage-config
Import
kubectl apply -f hf_secret.yaml
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| HF_TOKEN | string | Yes | HuggingFace Hub access token |
| GPU nodes | kubernetes nodes | Yes | Nodes with nvidia.com/gpu resource |
Outputs
| Name | Type | Description |
|---|---|---|
| Secret | v1.Secret | storage-config with HF_TOKEN |
| ServiceAccount | v1.ServiceAccount | hfserviceacc bound to storage-config |
Usage Examples
Setup and Verify
# 1. Create HF credentials
kubectl create namespace kserve-demo
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
name: storage-config
namespace: kserve-demo
type: Opaque
stringData:
HF_TOKEN: hf_aBcDeFgHiJkLmNoPqRsTuVwXyZ
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: hfserviceacc
namespace: kserve-demo
secrets:
- name: storage-config
EOF
# 2. Verify GPU availability
kubectl get nodes -o custom-columns='NAME:.metadata.name,GPU:.status.capacity.nvidia\.com/gpu'
Related Pages
Implements Principle
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment