Skip to content

Commit 48805c7

Browse files
committed
Add e2e tests for autoscaling
Add e2e tests to test autoscaling
1 parent d5880a7 commit 48805c7

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-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: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
27+
infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1"
28+
"sigs.k8s.io/cluster-api-provider-openstack/test/e2e/shared"
29+
)
30+
31+
var _ = Describe("Autoscaler on ClusterClass cluster [Autoscaler] [ClusterClass]", func() {
32+
capi_e2e.AutoscalerSpec(context.TODO(), func() capi_e2e.AutoscalerSpecInput {
33+
infraAPIGroup := infrav1.GroupName
34+
autoscalerFlavor := shared.FlavorTopology
35+
36+
return capi_e2e.AutoscalerSpecInput{
37+
E2EConfig: e2eCtx.E2EConfig,
38+
ClusterctlConfigPath: e2eCtx.Environment.ClusterctlConfigPath,
39+
BootstrapClusterProxy: e2eCtx.Environment.BootstrapClusterProxy,
40+
ArtifactFolder: e2eCtx.Settings.ArtifactFolder,
41+
SkipCleanup: false,
42+
ControlPlaneWaiters: e2eCtx.ControlPlaneWaiters,
43+
Flavor: &autoscalerFlavor,
44+
InfrastructureMachineTemplateKind: "openstackmachinetemplates",
45+
// We dont support machinePools
46+
InfrastructureMachinePoolTemplateKind: "",
47+
InfrastructureMachinePoolKind: "",
48+
InfrastructureAPIGroup: infraAPIGroup,
49+
AutoscalerVersion: e2eCtx.E2EConfig.GetVariable("AUTOSCALER_VERSION"),
50+
InstallOnManagementCluster: false,
51+
ScaleToAndFromZero: true,
52+
PostNamespaceCreated: nil,
53+
}
54+
})
55+
})

0 commit comments

Comments
 (0)