Skip to content

Commit 224eb49

Browse files
committed
Add e2e tests for autoscaling
1 parent 4dcc029 commit 224eb49

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

test/e2e/data/e2e_conf.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ variables:
213213
KUBERNETES_VERSION: "v1.34.2"
214214
KUBERNETES_VERSION_UPGRADE_FROM: "v1.33.1"
215215
KUBERNETES_VERSION_UPGRADE_TO: "v1.34.2"
216+
AUTOSCALER_VERSION: "v1.34.2"
216217
# NOTE: To see default images run kubeadm config images list (optionally with --kubernetes-version=vX.Y.Z)
217218
ETCD_VERSION_UPGRADE_TO: "3.5.21-0"
218219
COREDNS_VERSION_UPGRADE_TO: "v1.12.0"
@@ -222,6 +223,7 @@ variables:
222223
CCM: "../../data/ccm/cloud-controller-manager.yaml"
223224
EXP_CLUSTER_RESOURCE_SET: "true"
224225
EXP_CAPO_PRIORITY_QUEUE: "false"
226+
EXP_CAPO_AUTOSCALE_FROM_ZERO: "true"
225227
IP_FAMILY: "ipv4"
226228
OPENSTACK_BASTION_IMAGE_NAME: "cirros-0.6.1-x86_64-disk"
227229
OPENSTACK_BASTION_IMAGE_URL: https://storage.googleapis.com/artifacts.k8s-staging-capi-openstack.appspot.com/test/cirros/2022-12-05/cirros-0.6.1-x86_64-disk.img
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
//go:build e2e
2+
3+
/*
4+
Copyright 2025 The Kubernetes Authors.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
*/
18+
19+
package e2e
20+
21+
import (
22+
"context"
23+
24+
. "github.com/onsi/ginkgo/v2"
25+
capi_e2e "sigs.k8s.io/cluster-api/test/e2e"
26+
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
27+
28+
infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1"
29+
"sigs.k8s.io/cluster-api-provider-openstack/test/e2e/shared"
30+
)
31+
32+
var _ = Describe("Autoscaler on ClusterClass cluster [Autoscaler] [ClusterClass]", func() {
33+
capi_e2e.AutoscalerSpec(context.TODO(), func() capi_e2e.AutoscalerSpecInput {
34+
infraAPIGroup := infrav1.GroupName
35+
autoscalerFlavor := shared.FlavorTopology
36+
37+
return capi_e2e.AutoscalerSpecInput{
38+
E2EConfig: e2eCtx.E2EConfig,
39+
ClusterctlConfigPath: e2eCtx.Environment.ClusterctlConfigPath,
40+
BootstrapClusterProxy: e2eCtx.Environment.BootstrapClusterProxy,
41+
ArtifactFolder: e2eCtx.Settings.ArtifactFolder,
42+
SkipCleanup: false,
43+
ControlPlaneWaiters: clusterctl.ControlPlaneWaiters{
44+
WaitForControlPlaneInitialized: e2eCtx.E2EConfig.GetIntervals("default", "wait-control-plane"),
45+
WaitForControlPlaneReady: e2eCtx.E2EConfig.GetIntervals("default", "wait-control-plane"),
46+
},
47+
Flavor: &autoscalerFlavor,
48+
InfrastructureMachineTemplateKind: "openstackmachinetemplates",
49+
// CAPO does not support machinePools
50+
InfrastructureMachinePoolTemplateKind: "",
51+
InfrastructureMachinePoolKind: "",
52+
InfrastructureAPIGroup: infraAPIGroup,
53+
AutoscalerVersion: e2eCtx.E2EConfig.MustGetVariable("AUTOSCALER_VERSION"),
54+
InstallOnManagementCluster: false,
55+
ScaleToAndFromZero: true,
56+
PostNamespaceCreated: nil,
57+
}
58+
})
59+
})

0 commit comments

Comments
 (0)