Skip to content

Commit fbe6d58

Browse files
committed
test: add flatcar-sysext test
This test consumes the flatcar-sysext template to deploy a workload cluster. It uses a plain Flatcar OpenStack image from the release servers as it does not need to rely on the image-builder built image. Signed-off-by: Mathieu Tortuyaux <[email protected]>
1 parent 40a8e25 commit fbe6d58

File tree

5 files changed

+58
-1
lines changed

5 files changed

+58
-1
lines changed

hack/ci/cloud-init/controller.yaml.tpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
IMAGE_URLS+="https://storage.googleapis.com/artifacts.k8s-staging-capi-openstack.appspot.com/test/cirros/2022-12-05/cirros-0.6.1-x86_64-disk.img,"
6565
IMAGE_URLS+="https://storage.googleapis.com/artifacts.k8s-staging-capi-openstack.appspot.com/test/ubuntu/2023-09-29/ubuntu-2204-kube-v1.27.2.img,"
6666
IMAGE_URLS+="https://storage.googleapis.com/artifacts.k8s-staging-capi-openstack.appspot.com/test/ubuntu/2023-09-29/ubuntu-2204-kube-v1.28.2.img,"
67-
IMAGE_URLS+="https://storage.googleapis.com/artifacts.k8s-staging-capi-openstack.appspot.com/test/flatcar/flatcar-stable-3602.2.0-kube-v1.28.2.img"
67+
IMAGE_URLS+="https://storage.googleapis.com/artifacts.k8s-staging-capi-openstack.appspot.com/test/flatcar/flatcar-stable-3602.2.0-kube-v1.28.2.img,"
68+
IMAGE_URLS+="https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_openstack_image.img"
6869

6970
[[post-config|$NOVA_CONF]]
7071
[DEFAULT]

test/e2e/data/e2e_conf.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,10 @@ variables:
197197
# The default user for SSH connections from bastion to machines
198198
SSH_USER_MACHINE: "ubuntu"
199199
EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION: "true"
200+
# The Flatcar image produced by the image-builder
200201
OPENSTACK_FLATCAR_IMAGE_NAME: "flatcar-stable-3602.2.0-kube-v1.28.2"
202+
# A plain Flatcar from the Flatcar releases server
203+
FLATCAR_IMAGE_NAME: "flatcar_production_openstack_image"
201204

202205
intervals:
203206
conformance/wait-control-plane: ["30m", "10s"]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
resources:
3+
- ../../../../../kustomize/v1alpha7/flatcar-sysext
4+
5+
components:
6+
- ../common-patches/cni
7+
- ../common-patches/ccm

test/e2e/shared/defaults.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const (
5454
FlavorKCPRemediation = "kcp-remediation"
5555
FlavorFlatcar = "flatcar"
5656
FlavorKubernetesUpgrade = "k8s-upgrade"
57+
FlavorFlatcarSysext = "flatcar-sysext"
5758
)
5859

5960
// DefaultScheme returns the default scheme to use for testing.

test/e2e/suites/e2e/e2e_test.go

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,51 @@ var _ = Describe("e2e tests [PR-Blocking]", func() {
205205
})
206206
})
207207

208+
Describe("Workload cluster (flatcar-sysext)", func() {
209+
It("should be creatable and deletable", func() {
210+
// Flatcar default user is "core"
211+
shared.SetEnvVar(shared.SSHUserMachine, "core", false)
212+
213+
shared.Logf("Creating a cluster")
214+
clusterName := fmt.Sprintf("cluster-%s", namespace.Name)
215+
configCluster := defaultConfigCluster(clusterName, namespace.Name)
216+
configCluster.ControlPlaneMachineCount = pointer.Int64(3)
217+
configCluster.WorkerMachineCount = pointer.Int64(1)
218+
configCluster.Flavor = shared.FlavorFlatcarSysext
219+
createCluster(ctx, configCluster, clusterResources)
220+
md := clusterResources.MachineDeployments
221+
222+
workerMachines := framework.GetMachinesByMachineDeployments(ctx, framework.GetMachinesByMachineDeploymentsInput{
223+
Lister: e2eCtx.Environment.BootstrapClusterProxy.GetClient(),
224+
ClusterName: clusterName,
225+
Namespace: namespace.Name,
226+
MachineDeployment: *md[0],
227+
})
228+
controlPlaneMachines := framework.GetControlPlaneMachinesByCluster(ctx, framework.GetControlPlaneMachinesByClusterInput{
229+
Lister: e2eCtx.Environment.BootstrapClusterProxy.GetClient(),
230+
ClusterName: clusterName,
231+
Namespace: namespace.Name,
232+
})
233+
Expect(workerMachines).To(HaveLen(1))
234+
Expect(controlPlaneMachines).To(HaveLen(3))
235+
236+
shared.Logf("Waiting for worker nodes to be in Running phase")
237+
statusChecks := []framework.MachineStatusCheck{framework.MachinePhaseCheck(string(clusterv1.MachinePhaseRunning))}
238+
machineStatusInput := framework.WaitForMachineStatusCheckInput{
239+
Getter: e2eCtx.Environment.BootstrapClusterProxy.GetClient(),
240+
Machine: &workerMachines[0],
241+
StatusChecks: statusChecks,
242+
}
243+
framework.WaitForMachineStatusCheck(ctx, machineStatusInput, e2eCtx.E2EConfig.GetIntervals(specName, "wait-machine-status")...)
244+
245+
workloadCluster := e2eCtx.Environment.BootstrapClusterProxy.GetWorkloadCluster(ctx, namespace.Name, clusterName)
246+
247+
waitForDaemonSetRunning(ctx, workloadCluster.GetClient(), "kube-system", "openstack-cloud-controller-manager")
248+
249+
waitForNodesReadyWithoutCCMTaint(ctx, workloadCluster.GetClient(), 4)
250+
})
251+
})
252+
208253
Describe("Workload cluster (without lb)", func() {
209254
It("Should create port(s) with custom options", func() {
210255
shared.Logf("Creating a cluster")

0 commit comments

Comments
 (0)