Skip to content

Commit 1ade86a

Browse files
committed
test: add Flatcar e2e test
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
1 parent 60017aa commit 1ade86a

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

test/e2e/config/gcp-ci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ variables:
8686
KUBERNETES_VERSION_UPGRADE_TO: "${KUBERNETES_VERSION_UPGRADE_TO:-v1.30.5}"
8787
KUBERNETES_VERSION_UPGRADE_FROM: "${KUBERNETES_VERSION_UPGRADE_FROM:-v1.29.5}"
8888
EXP_CLUSTER_RESOURCE_SET: "true"
89+
# Required for Ignition based images (e.g Flatcar)
90+
EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION: "true"
91+
# TODO: Set this based on latest available image
92+
FLATCAR_IMAGE_ID: "projects/kinvolk-public/global/images/flatcar-stable-4081-2-0"
8993
CLUSTER_TOPOLOGY: "true"
9094
# Cluster Addons
9195
CNI: "${PWD}/test/e2e/data/cni/calico/calico.yaml"

test/e2e/e2e_test.go

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,50 @@ var _ = Describe("Workload cluster creation", func() {
206206
}, result)
207207
})
208208
})
209+
210+
Context("Creating a single Flatcar control-plane cluster", func() {
211+
It("Should create a cluster with 1 Flatcar worker node and can be scaled", func() {
212+
By("Initializes with 1 Flatcar worker node")
213+
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
214+
ClusterProxy: bootstrapClusterProxy,
215+
ConfigCluster: clusterctl.ConfigClusterInput{
216+
LogFolder: clusterctlLogFolder,
217+
ClusterctlConfigPath: clusterctlConfigPath,
218+
KubeconfigPath: bootstrapClusterProxy.GetKubeconfigPath(),
219+
InfrastructureProvider: clusterctl.DefaultInfrastructureProvider,
220+
Flavor: "flatcar",
221+
Namespace: namespace.Name,
222+
ClusterName: clusterName,
223+
KubernetesVersion: e2eConfig.GetVariable(KubernetesVersion),
224+
ControlPlaneMachineCount: ptr.To[int64](1),
225+
WorkerMachineCount: ptr.To[int64](1),
226+
ClusterctlVariables: map[string]string{"IMAGE_ID": e2eConfig.GetVariable(FlatcarImageID)},
227+
},
228+
WaitForClusterIntervals: e2eConfig.GetIntervals(specName, "wait-cluster"),
229+
WaitForControlPlaneIntervals: e2eConfig.GetIntervals(specName, "wait-control-plane"),
230+
WaitForMachineDeployments: e2eConfig.GetIntervals(specName, "wait-worker-nodes"),
231+
}, result)
232+
233+
By("Scaling Flatcar worker node to 3")
234+
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
235+
ClusterProxy: bootstrapClusterProxy,
236+
ConfigCluster: clusterctl.ConfigClusterInput{
237+
LogFolder: clusterctlLogFolder,
238+
ClusterctlConfigPath: clusterctlConfigPath,
239+
KubeconfigPath: bootstrapClusterProxy.GetKubeconfigPath(),
240+
InfrastructureProvider: clusterctl.DefaultInfrastructureProvider,
241+
Flavor: "flatcar",
242+
Namespace: namespace.Name,
243+
ClusterName: clusterName,
244+
KubernetesVersion: e2eConfig.GetVariable(KubernetesVersion),
245+
ControlPlaneMachineCount: ptr.To[int64](1),
246+
WorkerMachineCount: ptr.To[int64](3),
247+
ClusterctlVariables: map[string]string{"IMAGE_ID": e2eConfig.GetVariable(FlatcarImageID)},
248+
},
249+
WaitForClusterIntervals: e2eConfig.GetIntervals(specName, "wait-cluster"),
250+
WaitForControlPlaneIntervals: e2eConfig.GetIntervals(specName, "wait-control-plane"),
251+
WaitForMachineDeployments: e2eConfig.GetIntervals(specName, "wait-worker-nodes"),
252+
}, result)
253+
})
254+
})
209255
})

test/e2e/suite_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import (
4343
)
4444

4545
const (
46+
FlatcarImageID = "FLATCAR_IMAGE_ID"
4647
KubernetesVersion = "KUBERNETES_VERSION"
4748
KubernetesVersionManagement = "KUBERNETES_VERSION_MANAGEMENT"
4849

0 commit comments

Comments
 (0)