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
VPA: add InPlaceVerticalScaling feature gate to admission-controller
Adds logic to vpa admission webhook to deny requests creating VPAs with InPlaceOrRecreate update mode without enabling feature gate.
Also adds admission e2e logic to wait for the vpa-webhook to be registered before starting the test.
Signed-off-by: Max Cao <[email protected]>
Copy file name to clipboardexpand all lines: vertical-pod-autoscaler/docs/flags.md
+1
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ This document is auto-generated from the flag definitions in the VPA admission-c
12
12
|`--address`| ":8944" | The address to expose Prometheus metrics. |
13
13
|`--alsologtostderr`|| log to standard error as well as files (no effect when -logtostderr=true) |
14
14
|`--client-ca-file`| "/etc/tls-certs/caCert.pem" | Path to CA PEM file. |
15
+
|`--feature-gates`|| A set of key=value pairs that describe feature gates for alpha/experimental features. Options are: |
15
16
|`--ignored-vpa-object-namespaces`|| 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. |
16
17
|`--kube-api-burst`| 10 | QPS burst limit when making requests to Kubernetes apiserver |
17
18
|`--kube-api-qps`| 5 | QPS limit when making requests to Kubernetes apiserver |
returnfmt.Errorf("unexpected UpdateMode value %s", *mode)
124
125
}
126
+
if (*mode==vpa_types.UpdateModeInPlaceOrRecreate) &&!features.Enabled(features.InPlaceVerticalScaling) {
127
+
returnfmt.Errorf("in order to use UpdateMode %s, you must enable feature gate %s in the admission and updater args", vpa_types.UpdateModeInPlaceOrRecreate, features.InPlaceVerticalScaling)
expectError: fmt.Errorf("unexpected UpdateMode value bad"),
80
85
},
86
+
{
87
+
name: "InPlaceOrRecreate update mode not enabled by feature gate",
88
+
vpa: vpa_types.VerticalPodAutoscaler{
89
+
Spec: vpa_types.VerticalPodAutoscalerSpec{
90
+
UpdatePolicy: &vpa_types.PodUpdatePolicy{
91
+
UpdateMode: &inPlaceOrRecreateUpdateMode,
92
+
},
93
+
},
94
+
},
95
+
expectError: fmt.Errorf("in order to use UpdateMode %s, you must enable feature gate %s in the admission and updater args", vpa_types.UpdateModeInPlaceOrRecreate, features.InPlaceVerticalScaling),
0 commit comments