diff --git a/test/e2e/azure_test.go b/test/e2e/azure_test.go index 0717dc1978a..9fc53783458 100644 --- a/test/e2e/azure_test.go +++ b/test/e2e/azure_test.go @@ -1154,7 +1154,56 @@ 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() { + Context("Creating a self-managed VM based cluster using API Server ILB feature gate using default template [OPTIONAL][API-Server-ILB]", func() { + It("with three controlplane node and three worker nodes", func() { + 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, + 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) + + By("Probing workload cluster with APIServerILB feature gate", func() { + AzureAPIServerILBSpec(ctx, func() AzureAPIServerILBSpecInput { + return AzureAPIServerILBSpecInput{ + BootstrapClusterProxy: bootstrapClusterProxy, + Cluster: result.Cluster, + Namespace: namespace, + ClusterName: clusterName, + ExpectedWorkerNodes: result.ExpectedWorkerNodes(), + WaitIntervals: e2eConfig.GetIntervals(specName, "wait-worker-nodes"), + } + }) + }) + + By("PASSED!") + }) + }) + + Context("Creating a self-managed VM based cluster using API Server ILB feature gate and fully spec-ed out template [OPTIONAL][API-Server-ILB]", func() { It("with three controlplane node and three worker nodes", func() { clusterName = getClusterName(clusterNamePrefix, "apiserver-ilb")