Skip to content

Commit 6bacc28

Browse files
committed
E2E: Add quick-start test using ClusterClass
Signed-off-by: Lennart Jern <[email protected]>
1 parent b9fa78b commit 6bacc28

File tree

7 files changed

+99
-2
lines changed

7 files changed

+99
-2
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ e2e-templates: $(addprefix $(E2E_NO_ARTIFACT_TEMPLATES_DIR)/, \
188188
cluster-template-multi-network.yaml \
189189
cluster-template-without-lb.yaml \
190190
cluster-template.yaml \
191+
cluster-template-topology.yaml \
191192
cluster-template-flatcar.yaml \
192193
cluster-template-k8s-upgrade.yaml \
193194
cluster-template-flatcar-sysext.yaml \
@@ -556,6 +557,7 @@ generate-release-notes: $(RELEASE_NOTES_DIR) $(RELEASE_NOTES)
556557
.PHONY: templates
557558
templates: ## Generate cluster templates
558559
templates: templates/cluster-template.yaml \
560+
templates/cluster-template-topology.yaml \
559561
templates/cluster-template-without-lb.yaml \
560562
templates/cluster-template-flatcar.yaml \
561563
templates/cluster-template-flatcar-sysext.yaml \

templates/cluster-template-development.yaml renamed to kustomize/v1beta1/topology/cluster-template.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
apiVersion: cluster.x-k8s.io/v1beta1
1+
apiVersion: cluster.x-k8s.io/v1beta2
22
kind: Cluster
33
metadata:
44
name: ${CLUSTER_NAME}
55
spec:
66
topology:
7-
class: dev-test
7+
classRef:
8+
name: dev-test
89
version: ${KUBERNETES_VERSION}
910
controlPlane:
1011
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- cluster-template.yaml
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
apiVersion: cluster.x-k8s.io/v1beta2
2+
kind: Cluster
3+
metadata:
4+
name: ${CLUSTER_NAME}
5+
spec:
6+
topology:
7+
classRef:
8+
name: dev-test
9+
controlPlane:
10+
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
11+
variables:
12+
- name: identityRef
13+
value:
14+
cloudName: ${OPENSTACK_CLOUD:=capo-e2e}
15+
name: ${CLOUD_CONFIG_SECRET:=dev-test-cloud-config}
16+
- name: imageName
17+
value: ${IMAGE_NAME:=flatcar_production}
18+
- name: addImageVersion
19+
value: ${ADD_IMAGE_VERSION:=false}
20+
- name: injectIgnitionSysext
21+
value: ${INJECT_IGNITION_SYSEXT:=true}
22+
- name: allowedCIDRs
23+
value: ${OPENSTACK_API_SERVER_ALLOWED_CIDRS:=[]}
24+
- name: bastion
25+
value:
26+
enabled: ${OPENSTACK_BASTION_ENABLED:=false}
27+
spec:
28+
flavor: ${OPENSTACK_BASTION_FLAVOR:=m1.small}
29+
image:
30+
filter:
31+
name: ${OPENSTACK_BASTION_IMAGE_NAME:=ubuntu-24.04}
32+
sshKeyName: ${OPENSTACK_SSH_KEY_NAME:=""}
33+
version: ${KUBERNETES_VERSION}
34+
workers:
35+
machineDeployments:
36+
- class: default-worker
37+
name: md-0
38+
replicas: ${WORKER_MACHINE_COUNT}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
resources:
5+
- ../../../../../kustomize/v1beta1/topology
6+
7+
components:
8+
- ../components/cluster-resource-sets

test/e2e/shared/defaults.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const (
5252
OpenStackNodeMachineFlavor = "OPENSTACK_NODE_MACHINE_FLAVOR"
5353
SSHUserMachine = "SSH_USER_MACHINE"
5454
FlavorDefault = ""
55+
FlavorTopology = "topology"
5556
FlavorNoBastion = "no-bastion"
5657
FlavorWithoutLB = "without-lb"
5758
FlavorMultiNetwork = "multi-network"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//go:build e2e
2+
// +build e2e
3+
4+
/*
5+
Copyright 2024 The Kubernetes Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
*/
19+
20+
package e2e
21+
22+
import (
23+
"context"
24+
25+
. "github.com/onsi/ginkgo/v2"
26+
"k8s.io/utils/ptr"
27+
capi_e2e "sigs.k8s.io/cluster-api/test/e2e"
28+
29+
"sigs.k8s.io/cluster-api-provider-openstack/test/e2e/shared"
30+
)
31+
32+
var _ = Describe("When following the Cluster API quick-start with ClusterClass [PR-Blocking] [ClusterClass]", func() {
33+
capi_e2e.QuickStartSpec(context.TODO(), func() capi_e2e.QuickStartSpecInput {
34+
return capi_e2e.QuickStartSpecInput{
35+
E2EConfig: e2eCtx.E2EConfig,
36+
ClusterctlConfigPath: e2eCtx.Environment.ClusterctlConfigPath,
37+
BootstrapClusterProxy: e2eCtx.Environment.BootstrapClusterProxy,
38+
ArtifactFolder: e2eCtx.Settings.ArtifactFolder,
39+
SkipCleanup: false,
40+
Flavor: ptr.To(shared.FlavorTopology),
41+
}
42+
})
43+
})

0 commit comments

Comments
 (0)