Principle:Kserve Kserve Model Lifecycle Management
Appearance
| Knowledge Sources | |
|---|---|
| Domains | MLOps, Model_Management, Kubernetes |
| Last Updated | 2026-02-13 00:00 GMT |
Overview
A controller-based lifecycle management pattern for dynamically adding, updating, and removing models from a shared InferenceService.
Description
Model Lifecycle Management handles the full lifecycle of models in multi-model serving:
- Create: TrainedModel created → controller validates → writes to ConfigMap → agent loads model
- Update: TrainedModel storageUri changed → agent detects diff → unload old → load new
- Delete: TrainedModel deleted → finalizer cleans up ConfigMap → agent unloads model
- Cascade: Deleting the parent InferenceService triggers deletion of all associated TrainedModels
The controller uses Kubernetes finalizers to ensure cleanup is completed before resource removal.
Usage
Manage the model inventory by creating and deleting TrainedModel resources. The controller and agent handle all the underlying operations automatically.
Theoretical Basis
# Lifecycle management flow (NOT implementation code)
Create:
1. Fetch TrainedModel spec
2. Validate parent ISVC (exists, MMS, memory)
3. Add "trainedmodel.finalizer"
4. Write model spec to ConfigMap via ModelConfigReconciler
5. Update TrainedModel status conditions
Delete:
1. Finalizer intercepts deletion
2. Remove model from ConfigMap
3. Agent detects removal → unload model → delete files
4. Remove finalizer → allow Kubernetes to delete resource
Cascade:
- ISVC deletion triggers TrainedModel deletion
- Controller detects ISVC not found → allows cleanup
Related Pages
Implemented By
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment