|
| 1 | +# Rollout Strategy API Reference |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This document describes the API fields for rollout strategy configuration in KServe v1beta1. Rollout strategies can be configured through ConfigMap defaults or directly using Kubernetes `DeploymentStrategy`. |
| 6 | + |
| 7 | +## ComponentExtensionSpec |
| 8 | + |
| 9 | +The `ComponentExtensionSpec` supports two approaches for rollout strategy configuration: |
| 10 | + |
| 11 | +### Fields |
| 12 | + |
| 13 | +| Field | Type | Description | Required | |
| 14 | +|-------|------|-------------|----------| |
| 15 | +| `deploymentStrategy` | `appsv1.DeploymentStrategy` | Direct Kubernetes deployment strategy (highest priority) | No | |
| 16 | + |
| 17 | +### Configuration Priority |
| 18 | + |
| 19 | +1. **deploymentStrategy** - User-defined Kubernetes deployment strategy (highest priority) |
| 20 | +2. **ConfigMap rollout strategy** - Fallback when `defaultDeploymentMode` is `"Standard"` |
| 21 | + |
| 22 | +## RolloutSpec (ConfigMap Configuration) |
| 23 | + |
| 24 | +Defines the rollout strategy configuration for ConfigMap defaults. Users can configure different rollout modes by setting appropriate `maxSurge` and `maxUnavailable` values: |
| 25 | + |
| 26 | +**Availability Mode (Zero Downtime)**: |
| 27 | +- Set `maxUnavailable: "0"` and `maxSurge` to desired value/percentage |
| 28 | +- New pods are created before old pods are terminated |
| 29 | + |
| 30 | +**ResourceAware Mode (Resource Efficient)**: |
| 31 | +- Set `maxSurge: "0"` and `maxUnavailable` to desired value/percentage |
| 32 | +- Old pods are terminated before new pods are created |
| 33 | + |
| 34 | +### Fields |
| 35 | + |
| 36 | +| Field | Type | Description | Required | Default | |
| 37 | +|-------|------|-------------|----------|---------| |
| 38 | +| `maxSurge` | `string` | Maximum number of pods that can be created above desired replica count (e.g., `"1"`, `"25%"`) | Yes | - | |
| 39 | +| `maxUnavailable` | `string` | Maximum number of pods that can be unavailable during update (e.g., `"1"`, `"25%"`) | Yes | - | |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | +## DeployConfig |
| 44 | + |
| 45 | +The `DeployConfig` includes configuration for default rollout strategies. |
| 46 | + |
| 47 | +### Fields |
| 48 | + |
| 49 | +| Field | Type | Description | Required | |
| 50 | +|-------|------|-------------|----------| |
| 51 | +| `deploymentRolloutStrategy` | `DeploymentRolloutStrategy` | Default rollout strategy for deployments | No | |
| 52 | + |
| 53 | +## DeploymentRolloutStrategy |
| 54 | + |
| 55 | +Defines the default rollout strategy configuration for deployments. |
| 56 | + |
| 57 | +### Fields |
| 58 | + |
| 59 | +| Field | Type | Description | Required | |
| 60 | +|-------|------|-------------|----------| |
| 61 | +| `defaultRollout` | `RolloutSpec` | Default rollout configuration | No | |
| 62 | + |
| 63 | +## Example ConfigMap |
| 64 | + |
| 65 | +```yaml |
| 66 | +apiVersion: v1 |
| 67 | +kind: ConfigMap |
| 68 | +metadata: |
| 69 | + name: inferenceservice-config |
| 70 | + namespace: kserve |
| 71 | +data: |
| 72 | + deploy: |- |
| 73 | + { |
| 74 | + "defaultDeploymentMode": "Standard", |
| 75 | + "deploymentRolloutStrategy": { |
| 76 | + "defaultRollout": { |
| 77 | + "maxSurge": "1", # For Availability mode: set maxUnavailable: "0" |
| 78 | + "maxUnavailable": "1" # For ResourceAware mode: set maxSurge: "0" |
| 79 | + } |
| 80 | + } |
| 81 | + } |
| 82 | +``` |
| 83 | +
|
| 84 | +## Example InferenceService (Direct DeploymentStrategy) |
| 85 | +
|
| 86 | +### Availability Mode Example: |
| 87 | +```yaml |
| 88 | +apiVersion: serving.kserve.io/v1beta1 |
| 89 | +kind: InferenceService |
| 90 | +metadata: |
| 91 | + name: availability-mode-example |
| 92 | + annotations: |
| 93 | + serving.kserve.io/deploymentMode: "Standard" |
| 94 | +spec: |
| 95 | + predictor: |
| 96 | + model: |
| 97 | + modelFormat: |
| 98 | + name: sklearn |
| 99 | + storageUri: "s3://my-bucket/model" |
| 100 | + # Availability mode: maxUnavailable = 0, maxSurge = desired value |
| 101 | + deploymentStrategy: |
| 102 | + type: RollingUpdate |
| 103 | + rollingUpdate: |
| 104 | + maxUnavailable: "0" # Zero downtime |
| 105 | + maxSurge: "1" # Allow one extra pod |
| 106 | +``` |
| 107 | +
|
| 108 | +### ResourceAware Mode Example: |
| 109 | +```yaml |
| 110 | +apiVersion: serving.kserve.io/v1beta1 |
| 111 | +kind: InferenceService |
| 112 | +metadata: |
| 113 | + name: resource-aware-example |
| 114 | + annotations: |
| 115 | + serving.kserve.io/deploymentMode: "Standard" |
| 116 | +spec: |
| 117 | + predictor: |
| 118 | + model: |
| 119 | + modelFormat: |
| 120 | + name: sklearn |
| 121 | + storageUri: "s3://my-bucket/model" |
| 122 | + # ResourceAware mode: maxSurge = 0, maxUnavailable = desired value |
| 123 | + deploymentStrategy: |
| 124 | + type: RollingUpdate |
| 125 | + rollingUpdate: |
| 126 | + maxSurge: "0" # Resource efficient |
| 127 | + maxUnavailable: "1" # Allow one pod unavailable |
| 128 | +``` |
| 129 | +
|
| 130 | +## Example InferenceService (Using ConfigMap Defaults) |
| 131 | +
|
| 132 | +```yaml |
| 133 | +apiVersion: serving.kserve.io/v1beta1 |
| 134 | +kind: InferenceService |
| 135 | +metadata: |
| 136 | + name: example-configmap-defaults |
| 137 | + annotations: |
| 138 | + serving.kserve.io/deploymentMode: "Standard" |
| 139 | +spec: |
| 140 | + predictor: |
| 141 | + model: |
| 142 | + modelFormat: |
| 143 | + name: sklearn |
| 144 | + storageUri: "s3://my-bucket/model" |
| 145 | + # No deploymentStrategy specified - uses ConfigMap defaults |
| 146 | +``` |
| 147 | + |
| 148 | +## Validation Rules |
| 149 | + |
| 150 | +### For ConfigMap Configuration: |
| 151 | +1. **maxSurge Validation**: Must be a valid number or percentage string |
| 152 | + - Valid percentages: `"25%"`, `"50%"`, `"100%"` |
| 153 | + - Valid numbers: `"1"`, `"2"`, `"5"` |
| 154 | +2. **maxUnavailable Validation**: Same format as maxSurge |
| 155 | + |
| 156 | +### For Direct DeploymentStrategy: |
| 157 | +1. **type**: Must be `"RollingUpdate"` |
| 158 | +2. **rollingUpdate.maxSurge**: Same validation as ConfigMap maxSurge |
| 159 | +3. **rollingUpdate.maxUnavailable**: Same validation as ConfigMap maxUnavailable |
| 160 | + |
| 161 | +## Priority Order |
| 162 | + |
| 163 | +When configuring rollout strategies, the following priority order applies: |
| 164 | + |
| 165 | +1. **Multinode deployment override** (HIGHEST priority) - automatic for Ray workloads with `RAY_NODE_COUNT` environment variable |
| 166 | +2. **User-defined deploymentStrategy** (high priority) - specified in component extension spec |
| 167 | +3. **ConfigMap rollout strategy** (fallback) - only applies when `defaultDeploymentMode` is `"Standard"` |
| 168 | +4. **KServe default values** (if no configuration is provided) |
| 169 | + |
| 170 | +**Important**: The ConfigMap rollout strategy only applies when: |
| 171 | +- No user-defined `deploymentStrategy` is specified in the component spec |
| 172 | +- The `defaultDeploymentMode` in the ConfigMap is set to `"Standard"` |
| 173 | + |
| 174 | +## Default Values |
| 175 | + |
| 176 | +### KServe Defaults |
| 177 | +When no rollout strategy is specified anywhere, KServe applies these defaults: |
| 178 | +- **maxUnavailable**: `25%` |
| 179 | +- **maxSurge**: `25%` |
| 180 | + |
| 181 | +### Multinode Deployment Override |
| 182 | +For multinode deployments (Ray workloads), KServe automatically overrides ALL rollout strategy configurations with: |
| 183 | +- **maxUnavailable**: `0%` |
| 184 | +- **maxSurge**: `100%` |
| 185 | + |
| 186 | +This override takes precedence over all other configurations, including user-defined `deploymentStrategy`. |
| 187 | + |
| 188 | +### Default Values Summary |
| 189 | + |
| 190 | +| Configuration | maxUnavailable | maxSurge | Notes | |
| 191 | +|---------------|----------------|----------|-------| |
| 192 | +| **No rollout strategy specified** | `25%` | `25%` | KServe defaults | |
| 193 | +| **Multinode deployment** | `0%` | `100%` | Overrides ALL other configurations | |
| 194 | +| **Availability mode** | `0` | `<ratio>` | From rollout spec | |
| 195 | +| **ResourceAware mode** | `<ratio>` | `0` | From rollout spec | |
0 commit comments