Model Deployment
Advanced 16 min read Model Deployment

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.

kservekubernetesinferenceserviceknativeserving on k8scanary
Before we start

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
Introduction

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.

Motivation

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.
Think about it

Mental model

Imagine

A standardized food truck franchise

Think of

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.

Mechanics

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.

Apply InferenceService
Controller
Revision
Traffic split
Service/Route
Real world

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.
Guidelines

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.
Watch out

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.
When things break

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.
Interviews

Interview checkpoint

Practice

Hands-on lab

Declare a Serving Workload
40 min · advanced
In progress
Objectives
  • 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

0/3 steps
0%
sandbox · Linux sandbox
$
Try these commands
Test yourself

Quick quiz

0/2
1

What does an InferenceService primarily describe?

2

KServe canaries mean hunting servers; rollback is resetting the traffic split.

Go deeper

Official documentation