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/docs/api.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -201,6 +201,23 @@ _Appears in:_
201
201
|`containerRecommendations`_[RecommendedContainerResources](#recommendedcontainerresources) array_| Resources recommended by the autoscaler for each container. |||
202
202
203
203
204
+
#### RecommenderConfig
205
+
206
+
207
+
208
+
RecommenderConfig contains configuration for the recommender.
|`oomBumpUpRatio`_float_| OOMBumpUpRatio is the ratio to increase resources when OOM is detected. || Minimum: 1 <br /> |
218
+
|`oomMinBumpUp`_float_| OOMMinBumpUp is the minimum increase in resources when OOM is detected. || Minimum: 0 <br /> |
219
+
220
+
204
221
#### UpdateMode
205
222
206
223
_Underlying type:__string_
@@ -376,6 +393,7 @@ _Appears in:_
376
393
|`updatePolicy`_[PodUpdatePolicy](#podupdatepolicy)_| Describes the rules on how changes are applied to the pods.<br />If not specified, all fields in the `PodUpdatePolicy` are set to their<br />default values. |||
377
394
|`resourcePolicy`_[PodResourcePolicy](#podresourcepolicy)_| Controls how the autoscaler computes recommended resources.<br />The resource policy may be used to set constraints on the recommendations<br />for individual containers.<br />If any individual containers need to be excluded from getting the VPA recommendations, then<br />it must be disabled explicitly by setting mode to "Off" under containerPolicies.<br />If not specified, the autoscaler computes recommended resources for all containers in the pod,<br />without additional constraints. |||
378
395
|`recommenders`_[VerticalPodAutoscalerRecommenderSelector](#verticalpodautoscalerrecommenderselector) array_| Recommender responsible for generating recommendation for this object.<br />List should be empty (then the default recommender will generate the<br />recommendation) or contain exactly one recommender. |||
396
+
|`recommenderConfig`_[RecommenderConfig](#recommenderconfig)_| RecommenderConfig specifies the configuration for the recommender. |||
Copy file name to clipboardExpand all lines: vertical-pod-autoscaler/docs/flags.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,8 +93,8 @@ This document is auto-generated from the flag definitions in the VPA recommender
93
93
|`--metric-for-pod-labels`| "up{job=\"kubernetes-pods\"}" | Which metric to look for pod labels in metrics |
94
94
|`--min-checkpoints`| 10 | Minimum number of checkpoints to write per recommender's main loop |
95
95
|`--one-output`|| If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true) |
96
-
|`--oom-bump-up-ratio`| 1.2 |The memory bump up ratio when OOM occurred, default is 1.2. |
97
-
|`--oom-min-bump-up-bytes`| 1.048576e+08 |The minimal increase of memory when OOM occurred in bytes, default is 100 * 1024 * 1024 |
96
+
|`--oom-bump-up-ratio`| 1.2 |Default memory bump up ratio when OOM occurs. This value applies to all VPAs unless overridden in the VPA spec. Default is 1.2. |
97
+
|`--oom-min-bump-up-bytes`| 1.048576e+08 |Default minimal increase of memory (in bytes) when OOM occurs. This value applies to all VPAs unless overridden in the VPA spec. Default is 100 * 1024 * 1024 (100Mi).|
98
98
|`--password`|| The password used in the prometheus server basic auth |
99
99
|`--pod-label-prefix`| "pod_label_" | Which prefix to look for pod labels in metrics |
100
100
|`--pod-name-label`| "kubernetes_pod_name" | Label name to look for pod names |
gomega.Expect(err2.Error()).To(gomega.MatchRegexp(`.*admission webhook .*vpa.* denied the request: .*`))
834
+
ginkgo.By("Setting up invalid VPA objects")
835
+
testCases:= []struct {
836
+
namestring
837
+
vpaJSONstring
838
+
expectedErrstring
839
+
}{
840
+
{
841
+
name: "Invalid oomBumpUpRatio (negative value)",
842
+
vpaJSON: `{
843
+
"apiVersion": "autoscaling.k8s.io/v1",
844
+
"kind": "VerticalPodAutoscaler",
845
+
"metadata": {"name": "oom-test-vpa"},
846
+
"spec": {
847
+
"targetRef": {
848
+
"apiVersion": "apps/v1",
849
+
"kind": "Deployment",
850
+
"name": "oom-test"
851
+
},
852
+
"updatePolicy": {
853
+
"updateMode": "Auto"
854
+
},
855
+
"recommenderConfig": {
856
+
"oomBumpUpRatio": -1,
857
+
"oomMinBumpUp": 104857600
858
+
}
859
+
}
860
+
}`,
861
+
expectedErr: "spec.recommenderConfig.oomBumpUpRatio: Invalid value: -1: spec.recommenderConfig.oomBumpUpRatio in body should be greater than or equal to 1",
862
+
},
863
+
{
864
+
name: "Invalid oomBumpUpRatio (string value)",
865
+
vpaJSON: `{
866
+
"apiVersion": "autoscaling.k8s.io/v1",
867
+
"kind": "VerticalPodAutoscaler",
868
+
"metadata": {"name": "oom-test-vpa"},
869
+
"spec": {
870
+
"targetRef": {
871
+
"apiVersion": "apps/v1",
872
+
"kind": "Deployment",
873
+
"name": "oom-test"
874
+
},
875
+
"updatePolicy": {
876
+
"updateMode": "Auto"
877
+
},
878
+
"recommenderConfig": {
879
+
"oomBumpUpRatio": "12",
880
+
"oomMinBumpUp": 104857600
881
+
}
882
+
}
883
+
}`,
884
+
expectedErr: "json: cannot unmarshal string into Go struct field RecommenderConfig.spec.recommenderConfig.oomBumpUpRatio of type float64",
885
+
},
886
+
{
887
+
name: "Invalid oomBumpUpRatio (less than 1)",
888
+
vpaJSON: `{
889
+
"apiVersion": "autoscaling.k8s.io/v1",
890
+
"kind": "VerticalPodAutoscaler",
891
+
"metadata": {"name": "oom-test-vpa"},
892
+
"spec": {
893
+
"targetRef": {
894
+
"apiVersion": "apps/v1",
895
+
"kind": "Deployment",
896
+
"name": "oom-test"
897
+
},
898
+
"updatePolicy": {
899
+
"updateMode": "Auto"
900
+
},
901
+
"recommenderConfig": {
902
+
"oomBumpUpRatio": 0.5,
903
+
"oomMinBumpUp": 104857600
904
+
}
905
+
}
906
+
}`,
907
+
expectedErr: "spec.recommenderConfig.oomBumpUpRatio: Invalid value: 0.5: spec.recommenderConfig.oomBumpUpRatio in body should be greater than or equal to 1",
908
+
},
909
+
{
910
+
name: "Invalid oomMinBumpUp (negative value)",
911
+
vpaJSON: `{
912
+
"apiVersion": "autoscaling.k8s.io/v1",
913
+
"kind": "VerticalPodAutoscaler",
914
+
"metadata": {"name": "oom-test-vpa"},
915
+
"spec": {
916
+
"targetRef": {
917
+
"apiVersion": "apps/v1",
918
+
"kind": "Deployment",
919
+
"name": "oom-test"
920
+
},
921
+
"updatePolicy": {
922
+
"updateMode": "Auto"
923
+
},
924
+
"recommenderConfig": {
925
+
"oomBumpUpRatio": 2,
926
+
"oomMinBumpUp": -1
927
+
}
928
+
}
929
+
}`,
930
+
expectedErr: "spec.recommenderConfig.oomMinBumpUp: Invalid value: -1: spec.recommenderConfig.oomMinBumpUp in body should be greater than or equal to 0",
// EvictionChangeRequirement refers to the relationship between the new target recommendation for a Pod and its current requests, what kind of change is necessary for the Pod to be evicted
Copy file name to clipboardExpand all lines: vertical-pod-autoscaler/pkg/recommender/main.go
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -96,8 +96,8 @@ var (
96
96
memoryAggregationIntervalCount=flag.Int64("memory-aggregation-interval-count", model.DefaultMemoryAggregationIntervalCount, `The number of consecutive memory-aggregation-intervals which make up the MemoryAggregationWindowLength which in turn is the period for memory usage aggregation by VPA. In other words, MemoryAggregationWindowLength = memory-aggregation-interval * memory-aggregation-interval-count.`)
97
97
memoryHistogramDecayHalfLife=flag.Duration("memory-histogram-decay-half-life", model.DefaultMemoryHistogramDecayHalfLife, `The amount of time it takes a historical memory usage sample to lose half of its weight. In other words, a fresh usage sample is twice as 'important' as one with age equal to the half life period.`)
98
98
cpuHistogramDecayHalfLife=flag.Duration("cpu-histogram-decay-half-life", model.DefaultCPUHistogramDecayHalfLife, `The amount of time it takes a historical CPU usage sample to lose half of its weight.`)
99
-
oomBumpUpRatio=flag.Float64("oom-bump-up-ratio", model.DefaultOOMBumpUpRatio, `The memory bump up ratio when OOM occurred, default is 1.2.`)
100
-
oomMinBumpUp=flag.Float64("oom-min-bump-up-bytes", model.DefaultOOMMinBumpUp, `The minimal increase of memory when OOM occurred in bytes, default is 100 * 1024 * 1024`)
99
+
oomBumpUpRatio=flag.Float64("oom-bump-up-ratio", model.DefaultOOMBumpUpRatio, `Default memory bump up ratio when OOM occurs. This value applies to all VPAs unless overridden in the VPA spec. Default is 1.2.`)
100
+
oomMinBumpUp=flag.Float64("oom-min-bump-up-bytes", model.DefaultOOMMinBumpUp, `Default minimal increase of memory (in bytes) when OOM occurs. This value applies to all VPAs unless overridden in the VPA spec. Default is 100 * 1024 * 1024 (100Mi).`)
0 commit comments