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
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,8 @@ _Appears in:_
48
48
|`maxAllowed`_[ResourceList](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcelist-v1-core)_| Specifies the maximum amount of resources that will be recommended<br />for the container. The default is no maximum. |||
49
49
|`controlledResources`_[ResourceName](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcename-v1-core)_| Specifies the type of recommendations that will be computed<br />(and possibly applied) by VPA.<br />If not specified, the default of [ResourceCPU, ResourceMemory] will be used. |||
50
50
|`controlledValues`_[ContainerControlledValues](#containercontrolledvalues)_| Specifies which resource values should be controlled.<br />The default is "RequestsAndLimits". || Enum: [RequestsAndLimits RequestsOnly] <br /> |
51
+
|`oomBumpUpRatio`_float_| OOMBumpUpRatio is the ratio to increase resources when OOM is detected. || Minimum: 1 <br /> |
52
+
|`oomMinBumpUp`_float_| OOMMinBumpUp is the minimum increase in resources when OOM is detected. || Minimum: 0 <br /> |
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
+
"resourcePolicy": {
856
+
"containerPolicies": [{
857
+
"containerName": "*",
858
+
"oomBumpUpRatio": -1,
859
+
"oomMinBumpUp": 104857600
860
+
}]
861
+
}
862
+
}
863
+
}`,
864
+
expectedErr: "spec.resourcePolicy.containerPolicies[0].oomBumpUpRatio: Invalid value: -1: spec.resourcePolicy.containerPolicies[0].oomBumpUpRatio in body should be greater than or equal to 1",
865
+
},
866
+
{
867
+
name: "Invalid oomBumpUpRatio (string value)",
868
+
vpaJSON: `{
869
+
"apiVersion": "autoscaling.k8s.io/v1",
870
+
"kind": "VerticalPodAutoscaler",
871
+
"metadata": {"name": "oom-test-vpa"},
872
+
"spec": {
873
+
"targetRef": {
874
+
"apiVersion": "apps/v1",
875
+
"kind": "Deployment",
876
+
"name": "oom-test"
877
+
},
878
+
"updatePolicy": {
879
+
"updateMode": "Auto"
880
+
},
881
+
"resourcePolicy": {
882
+
"containerPolicies": [{
883
+
"containerName": "*",
884
+
"oomBumpUpRatio": "12",
885
+
"oomMinBumpUp": 104857600
886
+
}]
887
+
}
888
+
}
889
+
}`,
890
+
expectedErr: "json: cannot unmarshal string into Go struct field ContainerResourcePolicy.spec.resourcePolicy.containerPolicies.oomBumpUpRatio of type float64",
891
+
},
892
+
{
893
+
name: "Invalid oomBumpUpRatio (less than 1)",
894
+
vpaJSON: `{
895
+
"apiVersion": "autoscaling.k8s.io/v1",
896
+
"kind": "VerticalPodAutoscaler",
897
+
"metadata": {"name": "oom-test-vpa"},
898
+
"spec": {
899
+
"targetRef": {
900
+
"apiVersion": "apps/v1",
901
+
"kind": "Deployment",
902
+
"name": "oom-test"
903
+
},
904
+
"updatePolicy": {
905
+
"updateMode": "Auto"
906
+
},
907
+
"resourcePolicy": {
908
+
"containerPolicies": [{
909
+
"containerName": "*",
910
+
"oomBumpUpRatio": 0.5,
911
+
"oomMinBumpUp": 104857600
912
+
}]
913
+
}
914
+
}
915
+
}`,
916
+
expectedErr: "spec.resourcePolicy.containerPolicies[0].oomBumpUpRatio: Invalid value: 0.5: spec.resourcePolicy.containerPolicies[0].oomBumpUpRatio in body should be greater than or equal to 1",
917
+
},
918
+
{
919
+
name: "Invalid oomMinBumpUp (negative value)",
920
+
vpaJSON: `{
921
+
"apiVersion": "autoscaling.k8s.io/v1",
922
+
"kind": "VerticalPodAutoscaler",
923
+
"metadata": {"name": "oom-test-vpa"},
924
+
"spec": {
925
+
"targetRef": {
926
+
"apiVersion": "apps/v1",
927
+
"kind": "Deployment",
928
+
"name": "oom-test"
929
+
},
930
+
"updatePolicy": {
931
+
"updateMode": "Auto"
932
+
},
933
+
"resourcePolicy": {
934
+
"containerPolicies": [{
935
+
"containerName": "*",
936
+
"oomBumpUpRatio": 2,
937
+
"oomMinBumpUp": -1
938
+
}]
939
+
}
940
+
}
941
+
}`,
942
+
expectedErr: "spec.resourcePolicy.containerPolicies[0].oomMinBumpUp: Invalid value: -1: spec.resourcePolicy.containerPolicies[0].oomMinBumpUp in body should be greater than or equal to 0",
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