// Why this matters
If you want to self-host a 1T-parameter LLM on Kubernetes, the hard part is not the model, it is the platform around it. Teams reach for self-hosting when data cannot leave the tenant, when per-token pricing stops making sense at volume, or when they need to control the model version and sampling behaviour. A mixture-of-experts model with around a trillion total parameters and a few tens of billions active per token gives frontier-class answers, but it only pays off if you can run it reliably.
From the platform side, GPU capacity is the scarcest and most expensive resource in the cluster. An LLM server that is mis-sized either fails to schedule, wastes a whole node, or crash-loops while holding GPUs. A written capacity analysis and a GitOps delivery path turn an expensive experiment into something a second engineer can review, operate and roll back.
// The problem
A model of this size does not behave like a normal microservice. Weights alone are in the region of a terabyte or more depending on precision, so the first start downloads or loads a huge volume, which breaks default readiness probes. The process needs every GPU on the node to share the model through tensor parallelism, so a pod that requests 4 of 8 GPUs strands the rest. Node pools are autoscaled and expensive, so a failing rollout that keeps restarting is a real cost.
There is also tooling friction. Generic application Helm charts have strict value schemas, so passing Kubernetes-style env lists or unsupported keys fails at render time. Frameworks such as KServe add useful abstractions, but each one has assumptions about where weights come from. And Python dependency drift is a quiet killer: model code pulled at runtime imports helper functions that newer library releases have removed.
// The solution
I started with a capacity analysis rather than manifests. For every GPU pool in the cluster I recorded GPUs per node, GPU memory, vCPU, RAM, local NVMe and autoscaling bounds, then compared them to the model requirement: aggregate GPU memory above the weight size plus KV cache, RAM at least on the order of the vendor guidance, and enough fast disk to cache weights. An 8x80GB node (and later an 8x H200 bare-metal node) satisfied all three, while the single-GPU pools could not.
Serving uses vLLM with the OpenAI-compatible server. Tensor-parallel size equals the GPU count on the node, GPU memory utilisation is set high but not at the limit, and prefix caching is on because chat traffic repeats long system prompts. A replica is one pod owning one node. Scaling out means more nodes, so the HorizontalPodAutoscaler range is small and a ResourceQuota caps the total GPUs the namespace can claim.
Delivery is a FluxCD HelmRelease plus a kustomization containing the PVC, an ExternalSecret for tokens, a PodDisruptionBudget, a PriorityClass and a ServiceMonitor. Everything is a pull request, and Flux reconciles it. See Who Deploys the Deployer? Terraform-Bootstrapped FluxCD for how the GitOps control plane itself is bootstrapped.
I also evaluated KServe. Its LLMInferenceService is appealing because it bundles routing and scheduling, but it always adds a storage-initializer init container that downloads from the configured model URI, and the annotation that disables that only works for the classic InferenceService. For an image that already carries its own loading logic, that forced step was redundant and blocked startup. I documented the finding and used a plain HelmRelease; KServe remains the right tool when you want its model-storage and canary features.
- Capacity checklist GPU node pools, GPUs per node, RAM and NVMe against model needs
- Pick the node shapeone 8-GPU node per replica, tensor-parallel size 8
- ImagevLLM runtime with pinned torch and transformers versions
- Storagelarge PVC (or local NVMe) for weights and a cache volume
- Secretsregistry and model-hub tokens synced by External Secrets
- HelmReleaseGPU requests, tolerations, probes, vLLM arguments in Git
- Gate: Flux reconcile gateHelmRelease must render and install before pods exist
- Warm-upfirst start downloads weights, startup probe allows for it
- ObserveServiceMonitor scrapes vLLM metrics for GPU and queue health
- ServeOpenAI-compatible endpoint exposed inside the cluster
// Before you start
- A Kubernetes cluster with a GPU node pool (for example 8x 80GB GPUs per node) and the NVIDIA device plugin and drivers installed
- FluxCD installed and a Git repository it watches (Flux 2.x)
- Helm 3 and kubectl 1.28 or newer
- An image registry with a vLLM-based image you control, and a model-hub access token if the model is gated
- External Secrets Operator or an equivalent way to inject tokens
- Prometheus Operator CRDs if you want the ServiceMonitor
// Step-by-step implementation
01 Step 1. Run a GPU capacity analysis
Before writing YAML, list what the cluster can actually offer. The goal is a table of node pool versus model requirement. Look at allocatable GPUs, not just VM size, because system daemons and quotas reduce what you can schedule.
Record GPU memory in aggregate (for an 8x80GB node that is 640GB), system RAM, local NVMe and the autoscaler minimum and maximum. If the minimum node count is zero, plan for a cold start of several minutes on top of the model load.
02 Step 2. Build a vLLM image with pinned dependencies
Keep the image a pure runtime: CUDA base, torch, vLLM and a thin entrypoint. Do not bake terabytes of weights into the image unless you have a registry that can serve them; mount a volume and let the first start populate it.
Pin transformers and any library that the model repository code imports at runtime. A loose lower bound will silently pick up the latest release at build time, and model code that imports a removed helper will crash before weights even start downloading.
03 Step 3. Declare storage for weights and cache
Weights and the compile or prefix cache need a persistent volume, otherwise every restart repeats a huge download. Use a fast storage class and size it generously above the model size. ReadWriteOnce is fine when a replica owns a node.
04 Step 4. Inject the model-hub token with External Secrets
Never put the token in the values file. An ExternalSecret reads it from your vault and materialises a Kubernetes Secret that the pod references. If you use the pattern from Vault as the Control Plane: A Five-Tier Key Model with Locking, the same store serves the whole platform.
05 Step 5. Write the HelmRelease with tensor-parallel settings
This is the core. Request all eight GPUs, tolerate the GPU taint, pin to the pool with a node selector, and pass vLLM settings. Note the env format: generic charts usually want a flat map, not a Kubernetes name/value list, and an unsupported key can fail at template time with a confusing type error.
Raise the startup probe failure threshold so the first load does not get killed, and set a long termination grace period so in-flight requests finish.
06 Step 6. Add safety policies and metrics
A PodDisruptionBudget stops a node drain from evicting the only replica without warning. A ResourceQuota caps GPUs per namespace so a bad scale-up cannot swallow the pool. The ServiceMonitor lets Prometheus scrape vLLM metrics such as queue depth and KV cache usage; see Guardrails and Engineering Telemetry: Org Policy, Project Factory, Gatekeeper, Four Keys for the wider guardrail approach.
07 Step 7. Evaluate KServe and record the verdict
If you want KServe features, try an LLMInferenceService against a throwaway namespace. Check two things: does it inject a storage-initializer you cannot disable, and is the InferencePool controller ready? If either blocks you, fall back to a HelmRelease or a classic InferenceService.
08 Step 8. Smoke test the endpoint
Port-forward the service and send a chat completion. Check the first token latency, then a long prompt, then concurrent requests to see queueing in the metrics.
// How to verify it works
flux get helmrelease -n llm llm-servershows Ready True with the expected chart version.kubectl -n llm get pod -o wideshows one pod scheduled on a GPU node, andnvidia-smiinside it lists 8 devices with memory in use after load.curl /v1/modelsreturns the served model name; a chat completion returns text.- In Prometheus the vLLM metrics for running and waiting requests appear for the ServiceMonitor target.
- Delete the pod and confirm it restarts without re-downloading weights because the PVC cache is reused.
// Design decisions and trade-offs
- Capacity analysis first: a node must hold the weights, KV cache and runtime with headroom, so size by GPU memory, system RAM and local NVMe before touching manifests.
- One replica owns a whole 8-GPU node and uses tensor parallelism across it; autoscaling adds nodes, never splits a replica across nodes.
- Delivered as a FluxCD HelmRelease from Git so the model server is reviewed, diffable and revertable like any other workload.
- KServe LLMInferenceService evaluated and rejected for pre-built images because it always injects a storage-initializer; a plain HelmRelease was simpler.
- Pin every Python dependency in the image; an unpinned transformers range was the root cause of a crash loop.
// Pitfalls and lessons learned
- Unpinned dependency ranges in the image. An open-ended transformers requirement pulled a release that removed a helper the model code imported, producing a crash loop before any weight loaded.
- Helm chart value schemas. A Kubernetes-style env list produced an obscure expected-string-got-int template error; the chart wanted a flat map.
- Environment variables that the image entrypoint ignores. If the entrypoint hard-codes vLLM arguments, your values file changes nothing; read the entrypoint.
- Missing persistent storage. Without a PVC, every restart downloads the full model again.
- Default probes. A readiness probe that starts at 30 seconds kills a server that needs many minutes to load weights.
- Assuming a framework removes work. KServe's LLM resource adds a download step you cannot disable on some versions, and the routing controller must be healthy too.
// Frequently asked questions
How do I self-host a 1T-parameter LLM on Kubernetes?
Provision a GPU node with enough aggregate memory (an 8-GPU node), run vLLM with tensor parallelism equal to the GPU count, mount a large persistent volume for weights, and deploy it with a GitOps HelmRelease and long startup probes.
What tensor-parallel size should I use with vLLM?
Use the number of GPUs on one node so the model shards across the fast interconnect. Splitting a replica across nodes is possible but much slower.
Is KServe required to serve LLMs on Kubernetes?
No. KServe adds routing, canaries and model storage handling, but a plain Deployment or HelmRelease running vLLM is simpler when your image already loads its own weights.
Why does my vLLM pod crash loop on first start?
Common causes are dependency drift in the image, a missing token for gated models, no storage for the download, or probes that kill the pod while it loads.
How do I scale a model that needs a full node?
Scale by adding replicas, each on its own node, and cap them with a ResourceQuota. The cluster autoscaler adds nodes when a replica goes pending.
// The outcome
A one-trillion-parameter mixture-of-experts model running on 8 GPUs behind an OpenAI-compatible endpoint, delivered through GitOps, with the KServe evaluation and the Helm and dependency pitfalls written up for the next engineer.
// Where to take it next
- Add a gateway with authentication, rate limits and per-team usage metering in front of the endpoint.
- Try quantised weights to fit the model on fewer GPUs and compare quality.
- Benchmark with a load generator and set autoscaling on queue depth rather than CPU.
- Review Agentic SRE: MCP Servers and Workflow Agents for Change and Observability for agents that can safely use a private model.