Sub topic 2
How KServe Is Put Together
Assume you know Kubernetes pods, Deployments, Services, namespaces, and YAML manifests. You should also be comfortable applying resources with kubectl and making basic HTTP requests. KServe adds model-serving behavior to these Kubernetes foundations.
What KServe adds to Kubernetes
A plain Kubernetes Deployment can run a model server, but it does not understand model-specific concerns. You must choose the container image, expose the right ports, download the model, configure health checks, and create scaling and rollout rules yourself.
KServe packages these concerns behind a Kubernetes API. You describe the model and its serving requirements in an InferenceService resource. KServe's controller watches that resource and creates or configures the Kubernetes objects needed to serve it.
The controller does not perform inference. It coordinates the resources that do.
Main components
| Component | Responsibility |
|---|---|
| InferenceService | Declares the model, runtime, storage, traffic, and scaling configuration |
| KServe controller | Reconciles the declaration into running Kubernetes resources |
| Serving runtime | Starts a server that understands a model format and inference protocol |
| Storage initializer | Downloads model artifacts from object storage into the serving pod |
| Kubernetes Service | Provides stable network access to the model pods |
| Ingress or gateway | Routes external requests to the model service |
| Autoscaler | Adjusts the number of serving pods according to demand |
KServe installs CustomResourceDefinitions, or CRDs. A CRD extends the Kubernetes API with a new resource type. The InferenceService CRD lets Kubernetes store and validate KServe model-serving specifications just as it stores Deployments and Services.
The request path
A request normally enters through an ingress or gateway. Routing rules use the model service's host name or path to select the correct InferenceService. The Kubernetes Service then forwards the request to a serving pod.
Inside that pod, a runtime receives the request, loads or accesses the model, performs inference, and returns a response. The runtime may be a KServe-provided server for a common format such as scikit-learn, or it may be a custom server that implements KServe's expected protocol.
Model files usually live outside the cluster in object storage. The storage initializer downloads them before the model server becomes ready. This keeps large artifacts out of the container image and allows a new model version to use a different storage location.
Reconciliation and readiness
KServe follows Kubernetes' reconciliation model. The controller repeatedly compares the desired state in the InferenceService with the current cluster state. If a pod fails, a configuration changes, or a new model version is selected, the controller works toward the new desired state.
Readiness is important because a running container is not necessarily able to answer predictions. A serving pod should become ready only after its runtime has started and its model has loaded. Kubernetes Services and ingress components use readiness information to avoid sending requests to unprepared pods.
KServe also reports conditions on the InferenceService, such as whether the predictor is ready. Check these conditions before testing an endpoint.
How the pieces fit together
The InferenceService is the user-facing declaration. The controller is the translator. Kubernetes supplies scheduling, networking, secrets, and process management. A serving runtime supplies model-specific inference behavior. Object storage supplies versioned artifacts, while the autoscaler changes capacity as traffic changes.
This separation lets you change a model location or scaling policy without rebuilding the entire platform. It also means failures can occur at different layers. A service may have valid routing but a failed model download, or a healthy pod but an incorrect request protocol.
Exercise
Which component should you inspect first when an InferenceService has no serving pods: the model runtime or the KServe controller?
Show answer
Inspect the InferenceService status, controller events, and generated Kubernetes resources first. The controller must reconcile the resource before a runtime pod can serve requests.