From c26c423b1ca8ef23f3db34302f89bf6a0c4c4550 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Thu, 1 Apr 2021 08:47:09 +0200 Subject: [PATCH] storage e2e: disable health check containers They are not needed for any of the tests and may be causing too much overhead (see https://github.com/kubernetes/kubernetes/issues/102452#issuecomment-854452816). We already disabled them earlier and then re-enabled them again because it wasn't clear how much overhead they were causing. A recent change in how the sidecars get deployed (https://github.com/kubernetes/kubernetes/pull/102282) seems to have made the situation worse again. There's no logical explanation for that yet, though. (cherry picked from commit 0c2cee5676e64976f9e767f40c4c4750a8eeb11f) --- test/e2e/storage/drivers/csi.go | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/test/e2e/storage/drivers/csi.go b/test/e2e/storage/drivers/csi.go index 86dadab2f39..223be2edcca 100644 --- a/test/e2e/storage/drivers/csi.go +++ b/test/e2e/storage/drivers/csi.go @@ -47,6 +47,7 @@ import ( "github.com/onsi/ginkgo" "google.golang.org/grpc/codes" + appsv1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" storagev1 "k8s.io/api/storage/v1" @@ -236,7 +237,31 @@ func (h *hostpathCSIDriver) PrepareTest(f *framework.Framework) (*storageframewo NodeName: node.Name, } cleanup, err := utils.CreateFromManifests(config.Framework, driverNamespace, func(item interface{}) error { - return utils.PatchCSIDeployment(config.Framework, o, item) + if err := utils.PatchCSIDeployment(config.Framework, o, item); err != nil { + return err + } + + // Remove csi-external-health-monitor-agent and + // csi-external-health-monitor-controller + // containers. They are not needed for any of the + // tests and may be causing too much overhead when + // running in a large cluster (see + // https://github.com/kubernetes/kubernetes/issues/102452#issuecomment-854452816). + switch item := item.(type) { + case *appsv1.StatefulSet: + var containers []v1.Container + for _, container := range item.Spec.Template.Spec.Containers { + switch container.Name { + case "csi-external-health-monitor-agent", "csi-external-health-monitor-controller": + // Remove these containers. + default: + // Keep the others. + containers = append(containers, container) + } + } + item.Spec.Template.Spec.Containers = containers + } + return nil }, h.manifests...) if err != nil {