Skip to content

Commit 6461fa7

Browse files
committed
drop QuantityPercentage, rename QuantityValue to Quantity
1 parent d29d91f commit 6461fa7

File tree

1 file changed

+16
-20
lines changed
  • vertical-pod-autoscaler/enhancements/8515-support-custom-request-to-limit-ratio

1 file changed

+16
-20
lines changed

vertical-pod-autoscaler/enhancements/8515-support-custom-request-to-limit-ratio/README.md

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,10 @@ The feature is gated by a new alpha feature flag, `RequestToLimitRatio`, which i
3838
* Provide a feature gate to enable or disable the feature (`RequestToLimitRatio`).
3939
* Allow VPA to update the request-to-limit ratio of a Pod's containers during Pod recreation or in-place updates.
4040
* Introduce a new `RequestToLimitRatio` block that enables users to adjust the request-to-limit ratio in the following ways:
41-
* **Factor**: Multiplies the recommended request by a specified value, and the result is set as the new limit.
42-
* Example: if `factor` is set to `2`, the limit will be set to twice the recommended request.
43-
* **Quantity**: Adds a buffer on top of the resource request. This can be expressed either:
44-
* As a **percentage** (`QuantityPercentage`), or
45-
* As an **absolute value with units** (`QuantityValue`).
41+
* **Factor**: Multiplies the recommended request by a specified value, and the result is set as the new limit, for example:
42+
* If the value for `Factor` is set to `2`, the limit will be twice the recommended request.
43+
* If the value for `Factor` is set to `1.1`, the limit will be 10% higher than the recommended request.
44+
* **Quantity**: Adds a buffer on top of the resource request. This can be expressed as an **absolute value with units** (e.g. `100Mi`, `10m`).
4645

4746
## Non-Goals
4847

@@ -62,19 +61,16 @@ Some examples of the VPA CRD using the new `RequestToLimitRatio` field are provi
6261
A new `RequestToLimitRatio` field will be added, with the following sub-fields:
6362

6463
* `RequestToLimitRatio.CPU.Type` or `RequestToLimitRatio.Memory.Type` (type: `string`, required): Specifies how to apply limits proportionally to the requests. `Type` can have the following values:
65-
* `Factor` (type: `integer`): Interpreted as a multiplier for the recommended request.
64+
* `Factor` (type: `floating-point number`): Interpreted as a multiplier for the recommended request.
6665
* Example: a value of `2` will double the limits.
67-
* `QuantityValue` (type: `string`): Adds an absolute value on top of the requests to determine the new limit.
68-
* Example: for memory, a value of `100Mi` means the new limit will be: calculated Memory request + `100Mi`.
69-
* `QuantityPercentage` (type: `integer`): Increases the limit by the specified percentage of the resource request.
70-
* Example: if the request is 1000m CPU and the percentage is 20, the limit will be 1000m + (20% of 1000m) = 1200m.
66+
* `Quantity` (type: `string`): Adds an absolute value on top of the requests to determine the new limit.
67+
* Example: for memory, a value of `100Mi` means the new limit will be: calculated memory request + `100Mi`.
7168

7269
* `RequestToLimitRatio.CPU.Value` (type: `string`, required): Specifies the magnitude of the ratio between request and limit, interpreted according to `RequestToLimitRatio.CPU.Type`:
7370
* If `Type` is `Factor`: a value of `3` will triple the CPU limits.
74-
* If `Type` is `QuantityValue`: if the value is set to 200m, then the CPU limit will be set to the CPU request plus 200 millicores.
75-
* If `Type` is `QuantityPercentage`: a value of `20` increases the CPU limit by 20% of the calculated request.
71+
* If `Type` is `Quantity`: if the value is set to 200m, then the CPU limit will be set to the CPU request plus 200 millicores.
7672

77-
* `RequestToLimitRatio.Memory.Value` (type: `string`): Similar to `CPU.Value`, except that for `QuantityValue` the units are memory-based (e.g., `Mi`, `Gi`) rather than CPU millicores (`m`).
73+
* `RequestToLimitRatio.Memory.Value` (type: `string`, required): Similar to `CPU.Value`, except that for `Quantity` the units are memory-based (e.g., `Mi`, `Gi`) rather than CPU millicores (`m`).
7874

7975
### Behavior
8076

@@ -114,12 +110,11 @@ The behavior after implementing this feature is as follows:
114110

115111
* The `RequestToLimitRatio` configuration will be validated when VPA CRD objects are created or updated. For example:
116112
* If `Type` is `Factor`, the value must be greater than or equal to 1 (enforced via CRD validation rules).
117-
* If `Type` is `QuantityPercentage`, the value must be greater than or equal to 1 (enforced via CRD validation rules).
118113

119114
#### Dynamic Validation via Admission Controller
120115

121116
* When using the new `RequestToLimitRatio` field, the `controlledValues` field must be set to `RequestsAndLimits`. It does not make sense to specify `RequestToLimitRatio` if VPA is not allowed to update limits. This requirement is enforced by the admission controller.
122-
* If `Type` is set to `QuantityValue`, then its `Value` will be validated.
117+
* If `Type` is set to `Quantity`, then its `Value` will be validated.
123118

124119
### Feature Enablement and Rollback
125120

@@ -182,11 +177,11 @@ spec:
182177
Type: Factor
183178
Value: 2
184179
memory:
185-
Type: QuantityValue
180+
Type: Quantity
186181
Value: 200Mi
187182
```
188183
189-
In the manifest below, we configure VPA to control only the CPU resource's requests and limits for the container named `app`. The CPU limit is calculated by increasing the recommended CPU request by 30%.
184+
In the manifest below, we configure VPA to control only the CPU resource's requests and limits for the container named `app`. The CPU limit is calculated by increasing the recommended CPU request by 20% (i.e. `recommended request × 1.2`).
190185

191186
```yaml
192187
apiVersion: autoscaling.k8s.io/v1
@@ -207,10 +202,11 @@ spec:
207202
controlledValues: RequestsAndLimits
208203
RequestToLimitRatio:
209204
cpu:
210-
Type: QuantityPercentage
211-
Value: 30
205+
Type: Factor
206+
Value: 1.2
212207
```
213208

214209
## Implementation History
215210

216-
* 2025-09-10: Initial proposal created.
211+
* 2025-09-10: Initial proposal created.
212+
* 2025-09-10: Drop `QuantityPercentage` and rename `QuantityValue` to `Quantity`.

0 commit comments

Comments
 (0)