Skip to content

Commit 9018345

Browse files
upodroidserathius
authored andcommitted
Add addons node to scalability tests
1 parent dae411d commit 9018345

6 files changed

Lines changed: 51 additions & 6 deletions

File tree

tests/e2e/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ require (
2121
k8s.io/kops v1.34.1
2222
k8s.io/release v0.20.0
2323
sigs.k8s.io/boskos v0.0.0-20250922191614-14f95fc7cd0b
24-
sigs.k8s.io/kubetest2 v0.0.0-20250219121027-1cc02edeb0b6
24+
sigs.k8s.io/kubetest2 v0.0.0-20260227131255-e6d5899c1426
2525
sigs.k8s.io/yaml v1.6.0
2626
)
2727

@@ -170,7 +170,7 @@ require (
170170
github.com/go-openapi/swag/yamlutils v0.25.4 // indirect
171171
github.com/go-openapi/validate v0.25.1 // indirect
172172
github.com/go-piv/piv-go/v2 v2.4.0 // indirect
173-
github.com/go-resty/resty/v2 v2.16.2 // indirect
173+
github.com/go-resty/resty/v2 v2.16.5 // indirect
174174
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
175175
github.com/gobwas/glob v0.2.3 // indirect
176176
github.com/goccy/go-json v0.10.3 // indirect

tests/e2e/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,8 @@ github.com/go-piv/piv-go/v2 v2.4.0 h1:xamQ/fR4MJiw/Ndbk6yi7MVwhjrwlnDAPuaH9zcGb+
455455
github.com/go-piv/piv-go/v2 v2.4.0/go.mod h1:ShZi74nnrWNQEdWzRUd/3cSig3uNOcEZp+EWl0oewnI=
456456
github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI=
457457
github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
458-
github.com/go-resty/resty/v2 v2.16.2 h1:CpRqTjIzq/rweXUt9+GxzzQdlkqMdt8Lm/fuK/CAbAg=
459-
github.com/go-resty/resty/v2 v2.16.2/go.mod h1:0fHAoK7JoBy/Ch36N8VFeMsK7xQOHhvWaC3iOktwmIU=
458+
github.com/go-resty/resty/v2 v2.16.5 h1:hBKqmWrr7uRc3euHVqmh1HTHcKn99Smr7o5spptdhTM=
459+
github.com/go-resty/resty/v2 v2.16.5/go.mod h1:hkJtXbA2iKHzJheXYvQ8snQES5ZLGKMwQ07xAwp/fiA=
460460
github.com/go-rod/rod v0.116.2 h1:A5t2Ky2A+5eD/ZJQr1EfsQSe5rms5Xof/qj296e+ZqA=
461461
github.com/go-rod/rod v0.116.2/go.mod h1:H+CMO9SCNc2TJ2WfrG+pKhITz57uGNYU43qYHh438Mg=
462462
github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo=
@@ -1375,8 +1375,8 @@ sigs.k8s.io/controller-runtime v0.22.4 h1:GEjV7KV3TY8e+tJ2LCTxUTanW4z/FmNB7l327U
13751375
sigs.k8s.io/controller-runtime v0.22.4/go.mod h1:+QX1XUpTXN4mLoblf4tqr5CQcyHPAki2HLXqQMY6vh8=
13761376
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
13771377
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
1378-
sigs.k8s.io/kubetest2 v0.0.0-20250219121027-1cc02edeb0b6 h1:Qrq3FufC6BIPy4pAwHyaayBTO3RMvrSyU2ysfjTV73A=
1379-
sigs.k8s.io/kubetest2 v0.0.0-20250219121027-1cc02edeb0b6/go.mod h1:KCWjzDnj7tqUREqslYVb2qN/De3f2X7S+k/I3i4rbyA=
1378+
sigs.k8s.io/kubetest2 v0.0.0-20260227131255-e6d5899c1426 h1:ksphawLfLtnZEBuL6aMVrF0mjEhWtrWAMDXu5YRRum8=
1379+
sigs.k8s.io/kubetest2 v0.0.0-20260227131255-e6d5899c1426/go.mod h1:pBd0cFaT0hDqmwQg+TIhyLgPMYaH66QMLcKd09XnKTI=
13801380
sigs.k8s.io/promo-tools/v4 v4.1.0 h1:4N1tmjCzJwFlOgk00Woq3Rpd1esKbOr7t2okQBK7KWI=
13811381
sigs.k8s.io/promo-tools/v4 v4.1.0/go.mod h1:cGIUUfU8heXsfy/ESu+rTmGOeRXn88XIsIOvoUJ4LJs=
13821382
sigs.k8s.io/prow v0.0.0-20240619181241-cfb8754e0459 h1:t8nFAgqf4A53NMuaML7xbBkaKcQtN3aqPPHDsVLfWWs=

tests/e2e/kubetest2-kops/deployer/build.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ func (d *deployer) Build() error {
4747
if results.KopsBaseURL != "" {
4848
klog.Infof("setting kops base url to %q from build results", results.KopsBaseURL)
4949
d.KopsBaseURL = results.KopsBaseURL
50+
// In PreTestCmd, we need KOPS_BASE_URL to be set for kops calls
51+
os.Setenv("KOPS_BASE_URL", d.KopsBaseURL)
5052
}
5153

5254
if results.KubernetesBaseURL != "" {

tests/e2e/kubetest2-kops/deployer/up.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ func (d *deployer) Up() error {
5858
d.KopsBaseURL = baseURL
5959
}
6060

61+
// In PreTestCmd, we need KOPS_BASE_URL to be set for kops calls
62+
if os.Getenv("KOPS_BASE_URL") == "" {
63+
os.Setenv("KOPS_BASE_URL", d.KopsBaseURL)
64+
}
65+
6166
if d.terraform == nil {
6267
klog.Info("Cleaning up any leaked resources from previous cluster")
6368
// Intentionally ignore errors:
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2026 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -e
18+
set -x
19+
20+
# We need an instance group with a large single single node for addons such as prometheus, exec-service, etc.
21+
# In kubeup we used to call it heapster due to name of first addon, but now we call it addons.
22+
23+
if [[ "${CLOUD_PROVIDER}" == "aws" ]]; then
24+
kops create instancegroup addons --edit=false --role node --zone us-east-2b
25+
kops edit instancegroup addons --set=spec.machineType="${ADDONS_NODE_SIZE:-c7a.8xlarge}" \
26+
--set=spec.maxSize=1 --set=spec.minSize=1 --set=spec.image="ssm:/aws/service/canonical/ubuntu/server/24.04/stable/current/amd64/hvm/ebs-gp3/ami-id"
27+
elif [[ "${CLOUD_PROVIDER}" == "gce" ]]; then
28+
kops create instancegroup addons --edit=false --role node --zone us-east1-b
29+
kops edit instancegroup addons --set=spec.machineType="${ADDONS_NODE_SIZE:-c3-standard-22}" \
30+
--set=spec.maxSize=1 --set=spec.minSize=1 \
31+
--set=spec.image="${INSTANCE_IMAGE:-ubuntu-os-cloud/ubuntu-2404-noble-amd64-v20251001}"
32+
fi
33+
34+
kops update cluster --yes
35+
sleep 120 # it shouldn't take long to have the node up and ready
36+
# TODO: replace with kops validate instancegroup instead of the wait

tests/e2e/scenarios/scalability/run-test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ set -x
1919

2020
make test-e2e-install
2121

22+
REPO_ROOT=$(git rev-parse --show-toplevel)
2223
if [[ -z "${K8S_VERSION:-}" ]]; then
2324
K8S_VERSION=https://storage.googleapis.com/k8s-release-dev/ci/latest.txt
2425
fi
@@ -143,6 +144,7 @@ KUBETEST2_ARGS+=("--cloud-provider=${CLOUD_PROVIDER}")
143144
KUBETEST2_ARGS+=("--cluster-name=${CLUSTER_NAME:-}")
144145
KUBETEST2_ARGS+=("--admin-access=${ADMIN_ACCESS:-}")
145146
KUBETEST2_ARGS+=("--env=KOPS_FEATURE_FLAGS=${KOPS_FEATURE_FLAGS}")
147+
KUBETEST2_ARGS+=("--pre-test-cmd=${REPO_ROOT}/tests/e2e/scenarios/scalability/pre-test.sh")
146148
if [[ "${JOB_TYPE}" == "presubmit" && "${REPO_OWNER}/${REPO_NAME}" == "kubernetes/kops" ]]; then
147149
KUBETEST2_ARGS+=("--build")
148150
KUBETEST2_ARGS+=("--kops-binary-path=${GOPATH}/src/k8s.io/kops/.build/dist/linux/$(go env GOARCH)/kops")

0 commit comments

Comments
 (0)