@@ -1265,5 +1265,64 @@ var _ = Describe("Workload cluster creation", func() {
12651265 })
12661266 })
12671267
1268+ Context ("Local test: Creating a self-managed VM based cluster using API Server ILB feature gate and fully spec-ed out APIServer ILB template [OPTIONAL][API-Server-ILB][LOCAL]" , func () {
1269+ It ("with three controlplane node and three worker nodes" , func () {
1270+ clusterName = getClusterName (clusterNamePrefix , "apiserver-ilb" )
1271+
1272+ // Set the environment variables required for the API Server ILB feature gate
1273+ Expect (os .Setenv ("EXP_APISERVER_ILB" , "true" )).To (Succeed ())
1274+ Expect (os .Setenv ("AZURE_INTERNAL_LB_PRIVATE_IP" , "40.0.0.100" )).To (Succeed ())
1275+ Expect (os .Setenv ("AZURE_VNET_CIDR" , "40.0.0.0/8" )).To (Succeed ())
1276+ Expect (os .Setenv ("AZURE_CP_SUBNET_CIDR" , "40.0.0.0/16" )).To (Succeed ())
1277+ Expect (os .Setenv ("AZURE_NODE_SUBNET_CIDR" , "40.1.0.0/16" )).To (Succeed ())
1278+
1279+ clusterctl .ApplyClusterTemplateAndWait (ctx , createApplyClusterTemplateInput (
1280+ specName ,
1281+ withFlavor ("apiserver-ilb" ),
1282+ withNamespace (namespace .Name ),
1283+ withClusterName (clusterName ),
1284+ withControlPlaneMachineCount (3 ),
1285+ withWorkerMachineCount (2 ),
1286+ withControlPlaneInterval (specName , "wait-control-plane-ha" ),
1287+ withControlPlaneWaiters (clusterctl.ControlPlaneWaiters {
1288+ WaitForControlPlaneInitialized : EnsureControlPlaneInitializedNoAddons ,
1289+ }),
1290+ withPostMachinesProvisioned (func () {
1291+ PeerVnets (ctx , func () AzureAPIServerILBSpecInput {
1292+ return AzureAPIServerILBSpecInput {
1293+ BootstrapClusterProxy : bootstrapClusterProxy ,
1294+ Cluster : result .Cluster ,
1295+ Namespace : namespace ,
1296+ ClusterName : clusterName ,
1297+ WaitIntervals : e2eConfig .GetIntervals (specName , "wait-worker-nodes" ),
1298+ TemplateHasPrivateIPCustomDNSResolution : true ,
1299+ }
1300+ })
1301+ }),
1302+ // withPreWaitForCluster(func() {
1303+ // // TODO: only invoke this in local runs
1304+ // // Peer VNets of the mgmt cluster and workload cluster
1305+ //
1306+ // }),
1307+ ), result )
1308+
1309+ By ("Probing workload cluster with APIServerILB feature gate" , func () {
1310+ AzureAPIServerILBSpec (ctx , func () AzureAPIServerILBSpecInput {
1311+ return AzureAPIServerILBSpecInput {
1312+ BootstrapClusterProxy : bootstrapClusterProxy ,
1313+ Cluster : result .Cluster ,
1314+ Namespace : namespace ,
1315+ ClusterName : clusterName ,
1316+ ExpectedWorkerNodes : result .ExpectedWorkerNodes (),
1317+ WaitIntervals : e2eConfig .GetIntervals (specName , "wait-worker-nodes" ),
1318+ TemplateHasPrivateIPCustomDNSResolution : true ,
1319+ }
1320+ })
1321+ })
1322+
1323+ By ("PASSED!" )
1324+ })
1325+ })
1326+
12681327 // TODO: add a same test as above for a windows cluster
12691328})
0 commit comments