You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Feature Enablement and Rollback](#feature-enablement-and-rollback)
@@ -27,7 +31,7 @@
27
31
28
32
## Summary
29
33
30
-
Currently, VPA components (recommender, updater, admission controller) are configured through global flags. This makes it challenging to support different workloads with varying resource optimization needs within the same cluster. This proposal introduces the ability to specify configuration parameters at the individual VPA object level, allowing for workload-specific optimization strategies.
34
+
Currently, VPA components (recommender, updater, admission controller) are configured through global flags. This makes it challenging to support different workloads with varying resource optimization needs within the same cluster. This proposal introduces the ability to specify configuration parameters at the individual VPA object level, allowing for workload-specific optimization strategies. The goal is not to introduce new configuration options but rather to make existing internal configurations accessible and customizable per VPA object.
31
35
32
36
## Motivation
33
37
@@ -64,12 +68,12 @@ The configuration will be split into two sections: container-specific recommenda
64
68
apiVersion: autoscaling.k8s.io/v1
65
69
kind: VerticalPodAutoscaler
66
70
metadata:
67
-
name: oom-test-vpa
71
+
name: simple-vpa
68
72
spec:
69
73
targetRef:
70
74
apiVersion: apps/v1
71
75
kind: Deployment
72
-
name: oom-test
76
+
name: my-app
73
77
updatePolicy:
74
78
updateMode: Auto
75
79
evictAfterOOMThreshold: "5m"
@@ -85,19 +89,44 @@ spec:
85
89
### Parameter Descriptions
86
90
87
91
#### Container Policy Parameters
88
-
#### Container Policy Parameters
89
-
* `oomBumpUpRatio` (Quantity):
90
-
- Multiplier applied to memory recommendations after OOM events
91
-
- Represented as a Quantity (e.g., "1.5")
92
-
- Must be greater than or equal to 1
93
-
- Setting to 1 effectively disables the OOM ratio-based increase
94
-
- Controls how aggressively memory is increased after container crashes
95
-
96
-
* `oomMinBumpUp` (bytes):
97
-
- Minimum absolute memory increase after OOM events
98
-
- Setting to 0 effectively disables the OOM minimum increase
99
-
- When both `oomBumpUpRatio` = 1 and `oomMinBumpUp` = 0, OOM-based memory increases are completely disabled
100
-
- Ensures meaningful increases even for small containers
92
+
93
+
* `oomBumpUpRatio` and `oomMinBumpUp`:
94
+
These parameters work together to determine memory increases after OOM events.
95
+
The VPA selects the larger of:
96
+
- The absolute increase specified by `oomMinBumpUp`
97
+
- A relative increase calculated using `oomBumpUpRatio`
98
+
- If both are unset or set to their neutral values (`oomBumpUpRatio = 1`, `oomMinBumpUp = 0`), OOM-based increases are disabled.
99
+
100
+
This ensures:
101
+
- Small containers receive a guaranteed minimum bump (via `oomMinBumpUp`, e.g., +100MB).
Example: with oomBumpUpRatio: "1.5" and oomMinBumpUp: 104857600 (100MB):
113
+
- For a container using 50MB: max(50MB + 100MB, 50MB * 1.5) = 150MB
114
+
- For a container using 1GB: max(1GB + 100MB, 1GB * 1.5) = 1.5GB
115
+
116
+
Note: Using a single field approach (e.g., a unified `oomBumpUp` field) would not provide sufficient flexibility for users who need both a minimum absolute increase and a proportional ratio.
117
+
For example, if a user wants to ensure a minimum increase of 100MB while also applying a 1.5x ratio for larger containers, a single field cannot express this combined behavior. The current dual-field design allows users to specify both constraints independently, ensuring small containers get a guaranteed minimum bump while larger containers receive appropriate proportional scaling. This approach provides more precise control over memory recommendation adjustments after OOM events than a simplified single-field model could offer.
118
+
119
+
120
+
- `oomBumpUpRatio` (Quantity):
121
+
- Multiplier applied to memory recommendations after OOM events
122
+
- Represented as a Quantity (e.g., "1.5")
123
+
- Must be greater than or equal to 1
124
+
- Setting to 1 effectively disables the OOM ratio-based increase
125
+
- Controls how aggressively memory is increased after container crashes
126
+
127
+
- `oomMinBumpUp` (bytes):
128
+
- Minimum absolute memory increase after OOM events
129
+
- Setting to 0 effectively disables the OOM minimum increase
101
130
102
131
* `memoryAggregationInterval` (duration):
103
132
- Time window for aggregating memory usage data
@@ -117,6 +146,55 @@ Each parameter can be configured independently, falling back to global defaults
117
146
118
147
## Design Details
119
148
149
+
### Configuration Level Considerations
150
+
151
+
When designing the configuration parameters, we analyzed each parameter to determine the most appropriate configuration level:
- Different containers may have different memory usage patterns
167
+
- Some containers might need faster reaction times to memory changes
168
+
- Consistent with existing VPA container-level resource policies
169
+
- While `memoryAggregationInterval` and `memoryAggregationIntervalCount` are container-level, VPA-wide configuration can still be achieved using the wildcard container name "*"
- Pod-level operation that shouldn't vary by container
176
+
- Simpler operational model for pod lifecycle management
177
+
- Consistent with how Kubernetes handles pod evictions
178
+
179
+
#### Parameter Precedence: Per-VPA vs Global Configuration
180
+
181
+
The per-VPA configuration parameters introduced in this proposal are designed to **override** the corresponding global flags when specified in a VPA object. If a parameter is not defined at the VPA level, the VPA components will fall back to using the value set via global flags.
182
+
183
+
This approach ensures backward compatibility and allows users to adopt per-VPA configuration incrementally, without requiring changes to existing setups. Users can continue relying on global defaults while gradually introducing workload-specific tuning where needed.
184
+
185
+
For example:
186
+
- If `oomBumpUpRatio` is set in a VPA's `containerPolicy`, that value will be used for recommendations for that container.
187
+
- If it is omitted, the global flag value (e.g., from the recommender component) will apply.
188
+
189
+
This override behavior applies to all parameters introduced in this AEP:
190
+
- `oomBumpUpRatio`
191
+
- `oomMinBumpUp`
192
+
- `memoryAggregationInterval`
193
+
- `memoryAggregationIntervalCount`
194
+
- `evictAfterOOMThreshold`
195
+
196
+
Validation and error handling will ensure that invalid or conflicting values are caught early, either through CEL rules or admission controller logic.
197
+
120
198
### API Changes
121
199
122
200
#### Phase 1 (Current Proposal)
@@ -177,8 +255,8 @@ The `PerVPAConfig` feature requires VPA version 1.5.0 or higher. The feature is
177
255
Initial validation rules (CEL):
178
256
* `oomMinBumpUp` >= 0
179
257
* `memoryAggregationInterval` > 0
180
-
* `evictAfterOOMThreshold` > 0
181
258
* `memoryAggregationIntervalCount` > 0
259
+
* `evictAfterOOMThreshold` > 0
182
260
183
261
Validation via Admission Controller:
184
262
Some components cann't be validated using Common Expression Language (CEL). This validation is performed within the admission controller.
@@ -201,6 +279,7 @@ E2E tests will be included to verify:
201
279
## Implementation History
202
280
203
281
- 2025-04-12: Initial proposal
282
+
- 2025-09-06: Specify `oomBumpUpRatio` and `oomMinBumpUp` as container-level parameters
204
283
- Future: Additional parameters will be added based on user feedback and requirements
0 commit comments