Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ e2e-templates: $(addprefix $(E2E_NO_ARTIFACT_TEMPLATES_DIR)/, \
cluster-template-health-monitor.yaml \
cluster-template-capi-v1beta1.yaml \
cluster-template-cluster-identity.yaml \
cluster-template-topology-autoscaler.yaml)
cluster-template-topology-autoscaler.yaml \
cluster-template-topology-ubuntu.yaml \
cluster-template-topology-bastion.yaml)
# Currently no templates that require CI artifacts
# $(addprefix $(E2E_TEMPLATES_DIR)/, add-templates-here.yaml) \

Expand Down
2 changes: 2 additions & 0 deletions test/e2e/data/e2e_conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ providers:
- sourcePath: "./infrastructure-openstack-no-artifact/cluster-template-without-lb.yaml"
- sourcePath: "./infrastructure-openstack-no-artifact/cluster-template-cluster-identity.yaml"
- sourcePath: "./infrastructure-openstack-no-artifact/cluster-template-topology-autoscaler.yaml"
- sourcePath: "./infrastructure-openstack-no-artifact/cluster-template-topology-ubuntu.yaml"
- sourcePath: "./infrastructure-openstack-no-artifact/cluster-template-topology-bastion.yaml"
- sourcePath: "../../../templates/clusterclass-dev-test.yaml"
replacements:
- old: gcr.io/k8s-staging-capi-openstack/capi-openstack-controller:dev
Expand Down
39 changes: 39 additions & 0 deletions test/e2e/data/kustomize/topology-bastion/cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Topology cluster using a standard ubuntu image with bastion enabled.
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: ${CLUSTER_NAME}
spec:
topology:
classRef:
name: dev-test
version: ${KUBERNETES_VERSION}
controlPlane:
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
workers:
machineDeployments:
- class: default-worker
name: md-0
replicas: ${WORKER_MACHINE_COUNT}
variables:
- name: identityRef
value:
name: ${CLUSTER_NAME}-cloud-config
cloudName: ${OPENSTACK_CLOUD}
- name: imageRef
value: node-image
- name: addImageVersion
value: false
- name: injectIgnitionSysext
value: false
- name: allowedCIDRs
value: ${OPENSTACK_API_SERVER_ALLOWED_CIDRS:=[]}
- name: bastion
value:
enabled: true
spec:
flavor: ${OPENSTACK_BASTION_FLAVOR:=m1.small}
image:
imageRef:
name: bastion-image
sshKeyName: ${OPENSTACK_SSH_KEY_NAME:=""}
10 changes: 10 additions & 0 deletions test/e2e/data/kustomize/topology-bastion/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- cluster.yaml
- secret.yaml

components:
- ../components/images
- ../components/cluster-resource-sets
9 changes: 9 additions & 0 deletions test/e2e/data/kustomize/topology-bastion/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
data:
cacert: ${OPENSTACK_CLOUD_CACERT_B64}
clouds.yaml: ${OPENSTACK_CLOUD_YAML_B64}
kind: Secret
metadata:
labels:
clusterctl.cluster.x-k8s.io/move: "true"
name: ${CLUSTER_NAME}-cloud-config
39 changes: 39 additions & 0 deletions test/e2e/data/kustomize/topology-ubuntu/cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Topology cluster using a standard ubuntu image without ignition/sysext.
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: ${CLUSTER_NAME}
spec:
topology:
classRef:
name: dev-test
version: ${KUBERNETES_VERSION}
controlPlane:
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
workers:
machineDeployments:
- class: default-worker
name: md-0
replicas: ${WORKER_MACHINE_COUNT}
variables:
- name: identityRef
value:
name: ${CLUSTER_NAME}-cloud-config
cloudName: ${OPENSTACK_CLOUD}
- name: imageRef
value: node-image
- name: addImageVersion
value: false
- name: injectIgnitionSysext
value: false
- name: allowedCIDRs
value: ${OPENSTACK_API_SERVER_ALLOWED_CIDRS:=[]}
- name: bastion
value:
enabled: ${OPENSTACK_BASTION_ENABLED:=false}
spec:
flavor: ${OPENSTACK_BASTION_FLAVOR:=m1.small}
image:
imageRef:
name: bastion-image
sshKeyName: ${OPENSTACK_SSH_KEY_NAME:=""}
10 changes: 10 additions & 0 deletions test/e2e/data/kustomize/topology-ubuntu/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- cluster.yaml
- secret.yaml

components:
- ../components/images
- ../components/cluster-resource-sets
9 changes: 9 additions & 0 deletions test/e2e/data/kustomize/topology-ubuntu/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
data:
cacert: ${OPENSTACK_CLOUD_CACERT_B64}
clouds.yaml: ${OPENSTACK_CLOUD_YAML_B64}
kind: Secret
metadata:
labels:
clusterctl.cluster.x-k8s.io/move: "true"
name: ${CLUSTER_NAME}-cloud-config
2 changes: 2 additions & 0 deletions test/e2e/shared/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ const (
FlavorCapiV1Beta1 = "capi-v1beta1"
FlavorClusterIdentity = "cluster-identity"
FlavorTopologyAutoscaler = "topology-autoscaler"
FlavorTopologyUbuntu = "topology-ubuntu"
FlavorTopologyBastion = "topology-bastion"
)

// DefaultScheme returns the default scheme to use for testing.
Expand Down
55 changes: 55 additions & 0 deletions test/e2e/suites/e2e/clusterclass_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//go:build e2e

/*
Copyright 2025 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package e2e

import (
"context"

. "github.com/onsi/ginkgo/v2"
"k8s.io/utils/ptr"
capi_e2e "sigs.k8s.io/cluster-api/test/e2e"

shared "sigs.k8s.io/cluster-api-provider-openstack/test/e2e/shared"
)

var _ = Describe("ClusterClass with ubuntu image [ClusterClass]", func() {
capi_e2e.QuickStartSpec(context.TODO(), func() capi_e2e.QuickStartSpecInput {
return capi_e2e.QuickStartSpecInput{
E2EConfig: e2eCtx.E2EConfig,
ClusterctlConfigPath: e2eCtx.Environment.ClusterctlConfigPath,
BootstrapClusterProxy: e2eCtx.Environment.BootstrapClusterProxy,
ArtifactFolder: e2eCtx.Settings.ArtifactFolder,
SkipCleanup: false,
Flavor: ptr.To(shared.FlavorTopologyUbuntu),
}
})
})

var _ = Describe("ClusterClass with bastion [ClusterClass]", func() {
capi_e2e.QuickStartSpec(context.TODO(), func() capi_e2e.QuickStartSpecInput {
return capi_e2e.QuickStartSpecInput{
E2EConfig: e2eCtx.E2EConfig,
ClusterctlConfigPath: e2eCtx.Environment.ClusterctlConfigPath,
BootstrapClusterProxy: e2eCtx.Environment.BootstrapClusterProxy,
ArtifactFolder: e2eCtx.Settings.ArtifactFolder,
SkipCleanup: false,
Flavor: ptr.To(shared.FlavorTopologyBastion),
}
})
})