From 405f9a67fdd90f80d5afacfef1dc37e5979ed8e1 Mon Sep 17 00:00:00 2001 From: Nawaz Hussain Khazielakha Date: Wed, 4 Dec 2024 16:01:37 -0800 Subject: [PATCH] deploy apiserver ilb cluster in the e2e test --- test/e2e/azure_test.go | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/test/e2e/azure_test.go b/test/e2e/azure_test.go index 367737ded93..4d3369c2759 100644 --- a/test/e2e/azure_test.go +++ b/test/e2e/azure_test.go @@ -1156,14 +1156,39 @@ var _ = Describe("Workload cluster creation", func() { Context("Creating a self-managed VM based cluster using API Server ILB feature gate [OPTIONAL][API-Server-ILB]", func() { It("with one controlplane node and three worker nodes", func() { - // TODO: create a workload cluster with API Server ILB feature gate enabled + clusterName = getClusterName(clusterNamePrefix, "apiserver-ilb") + + // Set the environment variables required for the API Server ILB feature gate + Expect(os.Setenv("EXP_APISERVER_ILB", "true")).To(Succeed()) + Expect(os.Setenv("AZURE_INTERNAL_LB_PRIVATE_IP", "40.0.0.100")).To(Succeed()) + Expect(os.Setenv("AZURE_VNET_CIDR", "40.0.0.0/8")).To(Succeed()) + Expect(os.Setenv("AZURE_CP_SUBNET_CIDR", "40.0.0.0/16")).To(Succeed()) + Expect(os.Setenv("AZURE_NODE_SUBNET_CIDR", "40.1.0.0/16")).To(Succeed()) + + clusterctl.ApplyClusterTemplateAndWait(ctx, createApplyClusterTemplateInput( + specName, + withAzureCNIv1Manifest(e2eConfig.GetVariable(AzureCNIv1Manifest)), // AzureCNIManifest is set + withFlavor("apiserver-ilb"), + withNamespace(namespace.Name), + withClusterName(clusterName), + withControlPlaneMachineCount(3), + withWorkerMachineCount(2), + withControlPlaneInterval(specName, "wait-control-plane-ha"), + withControlPlaneWaiters(clusterctl.ControlPlaneWaiters{ + WaitForControlPlaneInitialized: EnsureControlPlaneInitializedNoAddons, + }), + withPostMachinesProvisioned(func() { + EnsureDaemonsets(ctx, func() DaemonsetsSpecInput { + return DaemonsetsSpecInput{ + BootstrapClusterProxy: bootstrapClusterProxy, + Namespace: namespace, + ClusterName: clusterName, + } + }) + }), + ), result) // TODO: deploy a sample deployment on the worker nodes // TODO: verify the worker node's /etc/hosts has the updated DNS entry for the Internal LB for the API Server - // AZURE_INTERNAL_LB_PRIVATE_IP = 40.0.0.100 - // AZURE_VNET_CIDR = 40.0.0.0/8 - // AZURE_CP_SUBNET_CIDR = 40.0.0.0/16 - // AZURE_NODE_SUBNET_CIDR = 40.1.0.0/16 - }) })