From 318dc0bf8ae13124332e738887fbfe1bd576bff4 Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Tue, 6 Sep 2022 11:37:35 +0200 Subject: [PATCH] test/e2e: Drop support for Kubernetes < v1.24.0 in the RuntimeSDK upgrade test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Büringer buringerst@vmware.com --- test/e2e/Makefile | 1 - test/e2e/cluster_upgrade_runtimesdk.go | 5 ++--- test/e2e/cluster_upgrade_runtimesdk_test.go | 21 +++---------------- test/e2e/config/docker.yaml | 1 - .../kustomization.yaml | 6 ------ .../mp-cgroupfs.yaml | 13 ------------ .../mp-default-cgroupfs.yaml | 10 --------- 7 files changed, 5 insertions(+), 52 deletions(-) delete mode 100644 test/e2e/data/infrastructure-docker/v1beta1/cluster-template-upgrades-runtimesdk-cgroupfs/kustomization.yaml delete mode 100644 test/e2e/data/infrastructure-docker/v1beta1/cluster-template-upgrades-runtimesdk-cgroupfs/mp-cgroupfs.yaml delete mode 100644 test/e2e/data/infrastructure-docker/v1beta1/cluster-template-upgrades-runtimesdk-cgroupfs/mp-default-cgroupfs.yaml diff --git a/test/e2e/Makefile b/test/e2e/Makefile index f6f87c733110..7cce002bc9ec 100644 --- a/test/e2e/Makefile +++ b/test/e2e/Makefile @@ -96,7 +96,6 @@ cluster-templates-v1beta1: $(KUSTOMIZE) ## Generate cluster templates for v1beta $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/cluster-template-upgrades --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/cluster-template-upgrades.yaml $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/cluster-template-upgrades-cgroupfs --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/cluster-template-upgrades-cgroupfs.yaml $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/cluster-template-upgrades-runtimesdk --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/cluster-template-upgrades-runtimesdk.yaml - $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/cluster-template-upgrades-runtimesdk-cgroupfs --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/cluster-template-upgrades-runtimesdk-cgroupfs.yaml $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/cluster-template-kcp-scale-in --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/cluster-template-kcp-scale-in.yaml $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/cluster-template-ipv6 --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/cluster-template-ipv6.yaml $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/cluster-template-topology.yaml diff --git a/test/e2e/cluster_upgrade_runtimesdk.go b/test/e2e/cluster_upgrade_runtimesdk.go index b10b1845bc49..48c55feb81cb 100644 --- a/test/e2e/cluster_upgrade_runtimesdk.go +++ b/test/e2e/cluster_upgrade_runtimesdk.go @@ -282,9 +282,8 @@ func clusterUpgradeWithRuntimeSDKSpec(ctx context.Context, inputGetter func() cl func extensionConfig(specName string, namespace *corev1.Namespace) *runtimev1.ExtensionConfig { return &runtimev1.ExtensionConfig{ ObjectMeta: metav1.ObjectMeta{ - // FIXME(sbueringer): use constant name for now as we have to be able to reference it in the ClusterClass. - // Random generate later on again when Yuvaraj's PR has split up the cluster lifecycle. - //Name: fmt.Sprintf("%s-%s", specName, util.RandomString(6)), + // Note: We have to use a constant name here as we have to be able to reference it in the ClusterClass + // when configuring external patches. Name: specName, Annotations: map[string]string{ runtimev1.InjectCAFromSecretAnnotation: fmt.Sprintf("%s/webhook-service-cert", namespace.Name), diff --git a/test/e2e/cluster_upgrade_runtimesdk_test.go b/test/e2e/cluster_upgrade_runtimesdk_test.go index 0ce1d79dde78..464de8f7d79b 100644 --- a/test/e2e/cluster_upgrade_runtimesdk_test.go +++ b/test/e2e/cluster_upgrade_runtimesdk_test.go @@ -28,26 +28,10 @@ import ( var _ = Describe("When upgrading a workload cluster using ClusterClass with RuntimeSDK [PR-Informing] [ClusterClass]", func() { clusterUpgradeWithRuntimeSDKSpec(ctx, func() clusterUpgradeWithRuntimeSDKSpecInput { - // "upgrades" is the same as the "topology" flavor but with an additional MachinePool. - flavor := pointer.String("upgrades-runtimesdk") - // For KubernetesVersionUpgradeFrom < v1.24 we have to use upgrades-cgroupfs flavor. - // This is because kind and CAPD only support: - // * cgroupDriver cgroupfs for Kubernetes < v1.24 - // * cgroupDriver systemd for Kubernetes >= v1.24. - // Notes: - // * We always use a ClusterClass-based cluster-template for the upgrade test - // * The ClusterClass will automatically adjust the cgroupDriver for KCP and MDs. - // * We have to handle the MachinePool ourselves - // * The upgrades-cgroupfs flavor uses an MP which is pinned to cgroupfs - // * During the upgrade UpgradeMachinePoolAndWait automatically drops the cgroupfs pinning - // when the target version is >= v1.24. - // TODO: We can remove this after the v1.25 release as we then only test the v1.24=>v1.25 upgrade. version, err := semver.ParseTolerant(e2eConfig.GetVariable(KubernetesVersionUpgradeFrom)) Expect(err).ToNot(HaveOccurred(), "Invalid argument, KUBERNETES_VERSION_UPGRADE_FROM is not a valid version") if version.LT(semver.MustParse("1.24.0")) { - // "upgrades-cgroupfs" is the same as the "topology" flavor but with an additional MachinePool - // with pinned cgroupDriver to cgroupfs. - flavor = pointer.String("upgrades-runtimesdk-cgroupfs") + Fail("This test only supports upgrades from Kubernetes >= v1.24.0") } return clusterUpgradeWithRuntimeSDKSpecInput{ @@ -56,7 +40,8 @@ var _ = Describe("When upgrading a workload cluster using ClusterClass with Runt BootstrapClusterProxy: bootstrapClusterProxy, ArtifactFolder: artifactFolder, SkipCleanup: skipCleanup, - Flavor: flavor, + // "upgrades" is the same as the "topology" flavor but with an additional MachinePool. + Flavor: pointer.String("upgrades-runtimesdk"), } }) }) diff --git a/test/e2e/config/docker.yaml b/test/e2e/config/docker.yaml index 98471a69a37a..1049a569d913 100644 --- a/test/e2e/config/docker.yaml +++ b/test/e2e/config/docker.yaml @@ -191,7 +191,6 @@ providers: - sourcePath: "../data/infrastructure-docker/v1beta1/cluster-template-upgrades.yaml" - sourcePath: "../data/infrastructure-docker/v1beta1/cluster-template-upgrades-cgroupfs.yaml" - sourcePath: "../data/infrastructure-docker/v1beta1/cluster-template-upgrades-runtimesdk.yaml" - - sourcePath: "../data/infrastructure-docker/v1beta1/cluster-template-upgrades-runtimesdk-cgroupfs.yaml" - sourcePath: "../data/infrastructure-docker/v1beta1/cluster-template-kcp-scale-in.yaml" - sourcePath: "../data/infrastructure-docker/v1beta1/cluster-template-ipv6.yaml" - sourcePath: "../data/infrastructure-docker/v1beta1/cluster-template-topology.yaml" diff --git a/test/e2e/data/infrastructure-docker/v1beta1/cluster-template-upgrades-runtimesdk-cgroupfs/kustomization.yaml b/test/e2e/data/infrastructure-docker/v1beta1/cluster-template-upgrades-runtimesdk-cgroupfs/kustomization.yaml deleted file mode 100644 index 2884b0190c95..000000000000 --- a/test/e2e/data/infrastructure-docker/v1beta1/cluster-template-upgrades-runtimesdk-cgroupfs/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -resources: -- ../cluster-template-upgrades-runtimesdk -- ./mp-cgroupfs.yaml - -patches: -- ./mp-default-cgroupfs.yaml diff --git a/test/e2e/data/infrastructure-docker/v1beta1/cluster-template-upgrades-runtimesdk-cgroupfs/mp-cgroupfs.yaml b/test/e2e/data/infrastructure-docker/v1beta1/cluster-template-upgrades-runtimesdk-cgroupfs/mp-cgroupfs.yaml deleted file mode 100644 index b9a5097f135d..000000000000 --- a/test/e2e/data/infrastructure-docker/v1beta1/cluster-template-upgrades-runtimesdk-cgroupfs/mp-cgroupfs.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# KubeadmConfigTemplate referenced by the MachinePool for cgroupfs -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfig -metadata: - name: "${CLUSTER_NAME}-mp-0-config-cgroupfs" -spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - # We have to pin the cgroupDriver to cgroupfs as kubeadm >=1.21 defaults to systemd - # kind will implement systemd support in: https://github.com/kubernetes-sigs/kind/issues/1726 - cgroup-driver: cgroupfs - eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0% diff --git a/test/e2e/data/infrastructure-docker/v1beta1/cluster-template-upgrades-runtimesdk-cgroupfs/mp-default-cgroupfs.yaml b/test/e2e/data/infrastructure-docker/v1beta1/cluster-template-upgrades-runtimesdk-cgroupfs/mp-default-cgroupfs.yaml deleted file mode 100644 index 08d8252542f3..000000000000 --- a/test/e2e/data/infrastructure-docker/v1beta1/cluster-template-upgrades-runtimesdk-cgroupfs/mp-default-cgroupfs.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachinePool -metadata: - name: "${CLUSTER_NAME}-mp-0" -spec: - template: - spec: - bootstrap: - configRef: - name: "${CLUSTER_NAME}-mp-0-config-cgroupfs" \ No newline at end of file