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
Copy file name to clipboardExpand all lines: vertical-pod-autoscaler/enhancements/8515-support-custom-request-to-limit-ratio/README.md
+19-13Lines changed: 19 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,17 +62,23 @@ Some examples of the VPA CRD using the new `RequestToLimitRatio` field are provi
62
62
63
63
A new `RequestToLimitRatio` field will be added, with the following sub-fields:
64
64
65
-
*`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
+
*[Optional]`RequestToLimitRatio.CPU.Type` or `RequestToLimitRatio.Memory.Type` (type `string`): Specifies how to apply limits proportionally to the requests. `Type` can have the following values:
66
66
*`Factor` (type: `floating-point number`): Interpreted as a multiplier for the recommended request.
67
67
* Example: a value of `2` will double the limits.
68
68
*`Quantity` (type: `string`): Adds an absolute value on top of the requests to determine the new limit.
69
-
* Example: for memory, a value of `100Mi` means the new limit will be: calculated memory request + `100Mi`.
69
+
* Example: for memory, a value of `100Mi` means the new limit will be: calculated memory request + `100Mi`.
70
+
* If `RequestToLimitRatio.CPU.Type` or `RequestToLimitRatio.Memory.Type` is not specified, the default value is `Factor`.
70
71
71
-
*`RequestToLimitRatio.CPU.Value` (type: `string`, required): Specifies the magnitude of the ratio between request and limit, interpreted according to `RequestToLimitRatio.CPU.Type`:
72
-
* If `Type` is `Factor`: a value of `3` will triple the CPU limits.
73
-
* 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.
72
+
*[Optional]`RequestToLimitRatio.CPU.Factor` (type`float`): The factor to apply to the CPU request.
73
+
* If `Type` is `Factor` a value of `3` will triple the CPU limits.
74
+
* If `Type` is `Quantity`, this field is not allowed.
74
75
75
-
*`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`).
76
+
*[Optional]`RequestToLimitRatio.CPU.Quantity` (type `Quantity`): The value specified in this field is added to the request to calculate the new limit.
77
+
* If `Type` is `Factor`, this field is not allowed.
78
+
* If `Type` is `Quantity` a CPU resource quantity added. For example, if the value is `200m`, the CPU limit will be calculated as the CPU request plus 200 millicores.
79
+
80
+
*[Optional]`RequestToLimitRatio.Memory.Factor` (type `float`): Same as `CPU.Factor`.
81
+
*[Optional]`RequestToLimitRatio.Memory.Quantity` (type `Quantity`): Similar to `CPU.Quantity` except that for `Quantity` the units are memory-based (e.g., `Mi`, `Gi`) rather than CPU millicores (`m`).
76
82
77
83
### Behavior
78
84
@@ -115,7 +121,7 @@ The behavior after implementing this feature is as follows:
115
121
116
122
* 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.
117
123
* Explicitly prohibit the use of `RequestToLimitRatio` for any resource not listed in `controlledResources`. For example, if the intention is to set a custom ratio for CPU, then the value of the `controlledResources` field must include `cpu`.
118
-
* If `Type` is set to `Quantity`, then its `Value` will be validated using the [ParseQuantity](https://github.com/kubernetes/apimachinery/blob/v0.34.1/pkg/api/resource/quantity.go#L277) function from `apimachinery`.
124
+
* If `Type` is set to `Quantity`, then its value will be validated using the [ParseQuantity](https://github.com/kubernetes/apimachinery/blob/v0.34.1/pkg/api/resource/quantity.go#L277) function from `apimachinery`.
119
125
120
126
121
127
### Feature Enablement and Rollback
@@ -186,11 +192,11 @@ spec:
186
192
controlledValues: RequestsAndLimits
187
193
RequestToLimitRatio:
188
194
cpu:
189
-
Type: Factor
190
-
Value: 2
195
+
type: Factor# this field is optional, if omitted it defaults to "Factor"
196
+
factor: 2
191
197
memory:
192
-
Type: Quantity
193
-
Value: 200Mi
198
+
type: Quantity
199
+
quantity: 200Mi
194
200
```
195
201
196
202
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`).
@@ -214,8 +220,8 @@ spec:
214
220
controlledValues: RequestsAndLimits
215
221
RequestToLimitRatio:
216
222
cpu:
217
-
Type: Factor
218
-
Value: 1.2
223
+
type: Factor # this field is optional, if omitted it defaults to "Factor"
0 commit comments