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
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ This document is auto-generated from the flag definitions in the VPA admission-c
14
14
|`address`| string | ":8944" | The address to expose Prometheus metrics. |
15
15
|`alsologtostderr`||| log to standard error as well as files (no effect when -logtostderr=true) |
16
16
|`client-ca-file`| string | "/etc/tls-certs/caCert.pem" | Path to CA PEM file. |
17
-
|`feature-gates`| mapStringBool || A set of key=value pairs that describe feature gates for alpha/experimental features. Options are:<br>AllAlpha=true\|false (ALPHA - default=false)<br>AllBeta=true\|false (BETA - default=false)<br>InPlaceOrRecreate=true\|false (BETA - default=true) |
17
+
|`feature-gates`| mapStringBool || A set of key=value pairs that describe feature gates for alpha/experimental features. Options are:<br>AllAlpha=true\|false (ALPHA - default=false)<br>AllBeta=true\|false (BETA - default=false)<br>InPlaceOrRecreate=true\|false (BETA - default=true)<br>PerVPAConfig=true\|false (ALPHA - default=false)|
18
18
|`ignored-vpa-object-namespaces`| string || A comma-separated list of namespaces to ignore when searching for VPA objects. Leave empty to avoid ignoring any namespaces. These namespaces will not be cleaned by the garbage collector. |
19
19
|`kube-api-burst`| float | 100 | QPS burst limit when making requests to Kubernetes apiserver |
20
20
|`kube-api-qps`| float | 50 | QPS limit when making requests to Kubernetes apiserver |
@@ -68,7 +68,7 @@ This document is auto-generated from the flag definitions in the VPA recommender
68
68
|`cpu-integer-post-processor-enabled`||| Enable the cpu-integer recommendation post processor. The post processor will round up CPU recommendations to a whole CPU for pods which were opted in by setting an appropriate label on VPA object (experimental) |
69
69
|`external-metrics-cpu-metric`| string || ALPHA. Metric to use with external metrics provider for CPU usage. |
70
70
|`external-metrics-memory-metric`| string || ALPHA. Metric to use with external metrics provider for memory usage. |
71
-
|`feature-gates`| mapStringBool || A set of key=value pairs that describe feature gates for alpha/experimental features. Options are:<br>AllAlpha=true\|false (ALPHA - default=false)<br>AllBeta=true\|false (BETA - default=false)<br>InPlaceOrRecreate=true\|false (BETA - default=true) |
71
+
|`feature-gates`| mapStringBool || A set of key=value pairs that describe feature gates for alpha/experimental features. Options are:<br>AllAlpha=true\|false (ALPHA - default=false)<br>AllBeta=true\|false (BETA - default=false)<br>InPlaceOrRecreate=true\|false (BETA - default=true)<br>PerVPAConfig=true\|false (ALPHA - default=false)|
72
72
|`history-length`| string | "8d" | How much time back prometheus have to be queried to get historical metrics |
73
73
|`history-resolution`| string | "1h" | Resolution at which Prometheus is queried for historical metrics |
74
74
|`humanize-memory`||| DEPRECATED: Convert memory values in recommendations to the highest appropriate SI unit with up to 2 decimal places for better readability. This flag is deprecated and will be removed in a future version. Use --round-memory-bytes instead. |
@@ -95,8 +95,8 @@ This document is auto-generated from the flag definitions in the VPA recommender
95
95
|`metric-for-pod-labels`| string | "up{job=\"kubernetes-pods\"}" | Which metric to look for pod labels in metrics |
96
96
|`min-checkpoints`| int | 10 | Minimum number of checkpoints to write per recommender's main loop. WARNING: this flag is deprecated and doesn't have any effect. It will be removed in a future release. Refer to update-worker-count to influence the minimum number of checkpoints written per loop. |
97
97
|`one-output`| severity || If true, only write logs to their native level (vs also writing to each lower severity level; no effect when -logtostderr=true) |
98
-
|`oom-bump-up-ratio`| float | 1.2 |The memory bump up ratio when OOM occurred, default is 1.2. |
99
-
|`oom-min-bump-up-bytes`| float | 1.048576e+08 |The minimal increase of memory when OOM occurred in bytes, default is 100 * 1024 * 1024 |
98
+
|`oom-bump-up-ratio`| float | 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. |
99
+
|`oom-min-bump-up-bytes`| float | 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).|
100
100
|`password`| string || The password used in the prometheus server basic auth. Can also be set via the PROMETHEUS_PASSWORD environment variable |
101
101
|`pod-label-prefix`| string | "pod_label_" | Which prefix to look for pod labels in metrics |
102
102
|`pod-name-label`| string | "kubernetes_pod_name" | Label name to look for pod names |
@@ -144,7 +144,7 @@ This document is auto-generated from the flag definitions in the VPA updater cod
144
144
|`eviction-rate-burst`| int | 1 | Burst of pods that can be evicted. |
145
145
|`eviction-rate-limit`| float || Number of pods that can be evicted per seconds. A rate limit set to 0 or -1 will disable<br>the rate limiter. (default -1) |
146
146
|`eviction-tolerance`| float | 0.5 | Fraction of replica count that can be evicted for update, if more than one pod can be evicted. |
147
-
|`feature-gates`| mapStringBool || A set of key=value pairs that describe feature gates for alpha/experimental features. Options are:<br>AllAlpha=true\|false (ALPHA - default=false)<br>AllBeta=true\|false (BETA - default=false)<br>InPlaceOrRecreate=true\|false (BETA - default=true) |
147
+
|`feature-gates`| mapStringBool || A set of key=value pairs that describe feature gates for alpha/experimental features. Options are:<br>AllAlpha=true\|false (ALPHA - default=false)<br>AllBeta=true\|false (BETA - default=false)<br>InPlaceOrRecreate=true\|false (BETA - default=true)<br>PerVPAConfig=true\|false (ALPHA - default=false)|
148
148
|`ignored-vpa-object-namespaces`| string || A comma-separated list of namespaces to ignore when searching for VPA objects. Leave empty to avoid ignoring any namespaces. These namespaces will not be cleaned by the garbage collector. |
149
149
|`in-recommendation-bounds-eviction-lifetime-threshold`|| 12h0m0s | duration Pods that live for at least that long can be evicted even if their request is within the [MinRecommended...MaxRecommended] range |
150
150
|`kube-api-burst`| float | 100 | QPS burst limit when making requests to Kubernetes apiserver |
gomega.Expect(err2.Error()).To(gomega.MatchRegexp(`.*admission webhook .*vpa.* denied the request: .*`))
874
+
ginkgo.By("Setting up invalid VPA objects")
875
+
testCases:= []struct {
876
+
namestring
877
+
vpaJSONstring
878
+
expectedErrstring
879
+
}{
880
+
{
881
+
name: "Invalid oomBumpUpRatio (negative value)",
882
+
vpaJSON: `{
883
+
"apiVersion": "autoscaling.k8s.io/v1",
884
+
"kind": "VerticalPodAutoscaler",
885
+
"metadata": {"name": "oom-test-vpa"},
886
+
"spec": {
887
+
"targetRef": {
888
+
"apiVersion": "apps/v1",
889
+
"kind": "Deployment",
890
+
"name": "oom-test"
891
+
},
892
+
"updatePolicy": {
893
+
"updateMode": "Auto"
894
+
},
895
+
"resourcePolicy": {
896
+
"containerPolicies": [{
897
+
"containerName": "*",
898
+
"oomBumpUpRatio": -1,
899
+
"oomMinBumpUp": 104857600
900
+
}]
901
+
}
902
+
}
903
+
}`,
904
+
expectedErr: "spec.resourcePolicy.containerPolicies[0].oomBumpUpRatio: Invalid value: -1: spec.resourcePolicy.containerPolicies[0].oomBumpUpRatio in body should be greater than or equal to 1",
905
+
},
906
+
{
907
+
name: "Invalid oomBumpUpRatio (string value)",
908
+
vpaJSON: `{
909
+
"apiVersion": "autoscaling.k8s.io/v1",
910
+
"kind": "VerticalPodAutoscaler",
911
+
"metadata": {"name": "oom-test-vpa"},
912
+
"spec": {
913
+
"targetRef": {
914
+
"apiVersion": "apps/v1",
915
+
"kind": "Deployment",
916
+
"name": "oom-test"
917
+
},
918
+
"updatePolicy": {
919
+
"updateMode": "Auto"
920
+
},
921
+
"resourcePolicy": {
922
+
"containerPolicies": [{
923
+
"containerName": "*",
924
+
"oomBumpUpRatio": "12",
925
+
"oomMinBumpUp": 104857600
926
+
}]
927
+
}
928
+
}
929
+
}`,
930
+
expectedErr: "json: cannot unmarshal string into Go struct field ContainerResourcePolicy.spec.resourcePolicy.containerPolicies.oomBumpUpRatio of type float64",
931
+
},
932
+
{
933
+
name: "Invalid oomBumpUpRatio (less than 1)",
934
+
vpaJSON: `{
935
+
"apiVersion": "autoscaling.k8s.io/v1",
936
+
"kind": "VerticalPodAutoscaler",
937
+
"metadata": {"name": "oom-test-vpa"},
938
+
"spec": {
939
+
"targetRef": {
940
+
"apiVersion": "apps/v1",
941
+
"kind": "Deployment",
942
+
"name": "oom-test"
943
+
},
944
+
"updatePolicy": {
945
+
"updateMode": "Auto"
946
+
},
947
+
"resourcePolicy": {
948
+
"containerPolicies": [{
949
+
"containerName": "*",
950
+
"oomBumpUpRatio": 0.5,
951
+
"oomMinBumpUp": 104857600
952
+
}]
953
+
}
954
+
}
955
+
}`,
956
+
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",
957
+
},
958
+
{
959
+
name: "Invalid oomMinBumpUp (negative value)",
960
+
vpaJSON: `{
961
+
"apiVersion": "autoscaling.k8s.io/v1",
962
+
"kind": "VerticalPodAutoscaler",
963
+
"metadata": {"name": "oom-test-vpa"},
964
+
"spec": {
965
+
"targetRef": {
966
+
"apiVersion": "apps/v1",
967
+
"kind": "Deployment",
968
+
"name": "oom-test"
969
+
},
970
+
"updatePolicy": {
971
+
"updateMode": "Auto"
972
+
},
973
+
"resourcePolicy": {
974
+
"containerPolicies": [{
975
+
"containerName": "*",
976
+
"oomBumpUpRatio": 2,
977
+
"oomMinBumpUp": -1
978
+
}]
979
+
}
980
+
}
981
+
}`,
982
+
expectedErr: "spec.resourcePolicy.containerPolicies[0].oomMinBumpUp: Invalid value: -1: spec.resourcePolicy.containerPolicies[0].oomMinBumpUp in body should be greater than or equal to 0",
0 commit comments