-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Which component are you using?:
/area vertical-pod-autoscaler
Is your feature request designed to solve a problem? If so describe the problem this feature should solve.:
If deploying the VPA in a namespace that is not kube-system there some e2e tests fail because they expect that hardcoded namespace. This is fundamentally different from how the VPA is setup where it is possible to use custom namespaces for certain features.
For example, for the admission-controller status lease, the VPA currently defaults to AdmissionControllerStatusNamespace = metav1.NamespaceSystem, but if the VPA container itself detects it is deployed in a differente namespace, it will default to that instead:
autoscaler/vertical-pod-autoscaler/pkg/updater/main.go
Lines 200 to 203 in 1332499
| admissionControllerStatusNamespace := status.AdmissionControllerStatusNamespace | |
| if namespace != "" { | |
| admissionControllerStatusNamespace = namespace | |
| } |
But the test just uses the kube-system namespace by default:
autoscaler/vertical-pod-autoscaler/e2e/v1/updater.go
Lines 45 to 53 in 2eb783b
| ginkgo.By("Setting up the Admission Controller status") | |
| stopCh := make(chan struct{}) | |
| statusUpdater := status.NewUpdater( | |
| f.ClientSet, | |
| status.AdmissionControllerStatusName, | |
| status.AdmissionControllerStatusNamespace, | |
| statusUpdateInterval, | |
| "e2e test", | |
| ) |
Another example, is this e2e helper function here, which assumes the recommender is in the kube-system namespace:
| namespace := "kube-system" |
Describe the solution you'd like.:
Perhaps a custom go test flag or environment variable can be used to specify a namespace other than kube-system as overrides.
Smaller ask, but I also would like the common namespace reference in the e2e tests to be centralized. Right now there exists VpaNamespace variable in e2e/vi/common, RecommenderNamespace in e2e/utils/common.go which also references the kube-system as well. And other future and existing namespaces referencing the VPA namespace should be pointed to by this centrailized variable as well.
Describe any alternative solutions you've considered.:
You can also tell me off, if you believe this is overengineering :-)
This is simple to fix in our fork, but since the namespace overrides work in the actual code, I would think it would make sense for the e2es to cover this as well.