Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Kserve Kserve Revision Status Propagation

From Leeroopedia
Knowledge Sources
Domains MLOps, Deployment_Strategy, Reliability
Last Updated 2026-02-13 00:00 GMT

Overview

Concrete Go functions for tracking revision history and propagating promotion/rollback status in KServe InferenceService.

Description

The PropagateStatus() function in inference_service_status.go tracks which revision is currently serving traffic. It updates LatestRolledoutRevision and PreviousRolledoutRevision based on the traffic percentages reported by Knative. This enables the system to know which version is active and which was previously active, supporting both promotion and rollback operations.

Usage

This function is called automatically during reconciliation. It processes Knative revision status to determine the promotion/rollback state. Users interact with it indirectly by modifying canaryTrafficPercent or removing it.

Code Reference

Source Location

  • Repository: kserve
  • File: pkg/apis/serving/v1beta1/inference_service_status.go, Lines 518-587

Signature

// PropagateStatus updates revision tracking based on traffic distribution
func (ss *InferenceServiceStatus) PropagateStatus(
    component ComponentType,
    serviceStatus *knservingv1.ServiceStatus,
)

// Status fields tracked:
// LatestRolledoutRevision  string  // Revision serving majority traffic
// PreviousRolledoutRevision string // Previously active revision

Import

import servingv1beta1 "github.com/kserve/kserve/pkg/apis/serving/v1beta1"

I/O Contract

Inputs

Name Type Required Description
component ComponentType Yes Component type (predictor, transformer, explainer)
serviceStatus *knservingv1.ServiceStatus Yes Knative Service status with traffic information

Outputs

Name Type Description
LatestRolledoutRevision string Name of revision serving 100% traffic after promotion
PreviousRolledoutRevision string Name of previously active revision (for rollback reference)

Usage Examples

Promote Canary

# Remove canaryTrafficPercent to promote
apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
  name: my-model
spec:
  predictor:
    tensorflow:
      storageUri: "gs://kfserving-examples/models/tensorflow/flowers-2"
# canaryTrafficPercent absent → 100% to latest revision

Rollback to Previous

# Set canaryTrafficPercent: 0 to rollback
apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
  name: my-model
spec:
  predictor:
    canaryTrafficPercent: 0
    tensorflow:
      storageUri: "gs://kfserving-examples/models/tensorflow/flowers-2"
# canaryTrafficPercent: 0 → 100% to previous stable revision
# Verify promotion
kubectl get inferenceservice my-model -o jsonpath='{.status.components.predictor}'
# Check latestRolledoutRevision and previousRolledoutRevision

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment