KServe
Serving as a Kubernetes resource, not a special project
KServe makes model serving a Kubernetes-native process: an InferenceService CRD with the serving runtime as a configuration. Serving, autoscaling, canaries and rollouts become cluster objects instead of bespoke ops.
What you will learn
- Map an InferenceService to pods, revisions and traffic splits
- Configure entrypoint and runtime (tensorflow/triton/sklearn) declaratively
- Express canary rollouts and rollbacks as config changes
What is this?
KServe abstracts model serving on Kubernetes into a declarative InferenceService resource: you say which model, which runtime and how much traffic goes where; the controller builds the serving deployment, wires autoscaling and exposes an inference endpoint.
Why do you need it?
- Serving becomes config in the cluster, so promotion, canary and rollback are GitOps affordances.
- It reuses Kubernetes primitives — Deployments, HPA, services — instead of a parallel world.
- Runtime images (sklearn, XGBoost, Triton, PyTorch) are selectable per model.
- Traffic splitting declvs canaries without extra deployment machinery.
Mental model
A standardized food truck franchise
KServe InferenceService
Franchise headquarters (controller) provides the truck, permits and menu template; each truck (InferenceService) declares what it serves and its hours. New openings and menu changes are paperwork (config), not building new kitchens.
How it works
- You apply an InferenceService YAML naming the model and a serving runtime image.
- The controller reconciles it: creates a revision, deployment, service and autoscaling config.
- Traffic split fields route percentage between newer and current revisions.
- Knative handles scale-to-zero or minimum replicas per config.
- Rollback = resetting traffic split; the old revision is still addressable.
Reconciliation of an InferenceService.
In production
- A team rolls a new churn version with 10% traffic via a one-line canary field change.
- A bursty recommender uses scale-to-zero to save cluster cost off-peak.
- Promotion runs as a GitOps PR that bumps the registered model version in the InferenceService.
Best practices
- Let the controller own serving; only reference registered artifacts.
- Use traffic splits for real canaries with monitoring before 100%.
- Pin runtime images and model versions together for reproducibility.
- Keep scale-to-zero off for latency-sensitive models; use minimum replicas.
Common mistakes
- Hand-managing the deployment KServe created — you're now fighting the controller.
- Canaries without evaluation, so splits are theater.
- Missing resource limits; a bursty model starves the node beneath KServe.
- Runtime image drift between environments.
Debugging tips
- InferenceService stuck not-ready — check the revision's PodFailed conditions and image pull logs.
- Traffic split not shifting — the revision may be from the wrong model version; verify with curl headers.
- Scale-to-zero latency — re-acquisition at idle; raise minimum replicas for interactive workloads.
Interview checkpoint
Hands-on lab
- Author an InferenceService manifest by hand
- Model traffic-split canary semantics
- Apply the manifest to a local cluster if available; else validate declaratively
Declare a Serving Workload
40 min · advanced
Quick quiz
What does an InferenceService primarily describe?
KServe canaries mean hunting servers; rollback is resetting the traffic split.