Skip to content

Commit 0140334

Browse files
committed
Switch default capi infra provider to k0smotron in e2e
Signed-off-by: apedriza <[email protected]>
1 parent f1c73fc commit 0140334

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1468
-1487
lines changed

.github/workflows/e2e-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ jobs:
138138
- name: Run e2e test
139139
run: |
140140
export AWS_B64ENCODED_CREDENTIALS=$(clusterawsadm bootstrap credentials encode-as-profile)
141-
make e2e TEST_NAME="${{ matrix.e2e-suite }}" E2E_CONF_FILE="$(pwd)/e2e/config/aws.yaml"
141+
make e2e-aws TEST_NAME="${{ matrix.e2e-suite }}"
142142
143143
- name: Archive artifacts
144144
if: failure()

.github/workflows/go.yml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -186,23 +186,6 @@ jobs:
186186
run: |
187187
make -C inttest ${{ matrix.smoke-suite }}
188188
189-
190-
capi-smokes-on-different-k0s-versions:
191-
name: CAPI Smokes Matrix
192-
needs: [build, unittest]
193-
strategy:
194-
fail-fast: false
195-
matrix:
196-
smoke-suite:
197-
- check-capi-remote-machine
198-
- check-capi-remote-machine-template
199-
k0s-version: [ "v1.28.11", "v1.29.6", "v1.30.2" ]
200-
201-
uses: ./.github/workflows/capi-smoke-tests.yml
202-
with:
203-
smoke-suite: ${{ matrix.smoke-suite }}
204-
k0s-version: ${{ matrix.k0s-version }}
205-
206189
capi-smokes:
207190
name: Cluster API smoke tests
208191
needs: [build, unittest]
@@ -223,7 +206,6 @@ jobs:
223206
- check-capi-controlplane-docker-worker
224207
- check-capi-docker-machine-change-args
225208
- check-capi-docker-machine-change-template
226-
- check-capi-remote-machine-template-update
227209
- check-capi-docker-machine-template-update
228210
- check-capi-docker-machine-template-update-recreate
229211
- check-capi-docker-machine-template-update-recreate-single
@@ -285,6 +267,6 @@ jobs:
285267
if: failure()
286268
uses: actions/[email protected]
287269
with:
288-
name: e2e-artifacts
270+
name: e2e-artifacts-${{ matrix.e2e-suite }}
289271
path: _artifacts
290272
if-no-files-found: ignore

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,5 @@ __debug_bin*
4242
_artifacts
4343

4444
# E2E test templates
45-
e2e/data/infrastructure-docker/**/cluster-template*.yaml
45+
e2e/data/infrastructure-docker/**/cluster-template*.yaml
46+
e2e/data/infrastructure-k0smotron/**/cluster-template*.yaml

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
1515
CRDOC ?= $(LOCALBIN)/crdoc
1616

1717
## e2e configuration
18-
E2E_CONF_FILE ?= $(shell pwd)/e2e/config/docker.yaml
18+
E2E_CONF_FILE ?= $(shell pwd)/e2e/config.yaml
19+
E2E_INFRASTRUCTURE_PROVIDER ?= k0sproject-k0smotron
1920
SKIP_RESOURCE_CLEANUP ?= false
2021
# Artifacts folder generated for e2e tests
2122
ARTIFACTS ?= $(shell pwd)/_artifacts
@@ -116,7 +117,9 @@ vet: ## Run go vet against code.
116117
test: $(ENVTEST)
117118
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $(GO_TEST_DIRS) -run '$(TEST_NAME)' -coverprofile cover.out
118119

120+
## Template by infrastructure provider for e2e tests
119121
DOCKER_TEMPLATES := e2e/data/infrastructure-docker
122+
K0SMOTRON_TEMPLATES := e2e/data/infrastructure-k0smotron
120123

121124
.PHONY: generate-e2e-templates-main
122125
generate-e2e-templates-main: $(KUSTOMIZE)
@@ -127,6 +130,7 @@ generate-e2e-templates-main: $(KUSTOMIZE)
127130
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-machinedeployment --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-machinedeployment.yaml
128131
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-remote-hcp --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-remote-hcp.yaml
129132
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-ingress --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-ingress.yaml
133+
$(KUSTOMIZE) build $(K0SMOTRON_TEMPLATES)/main/cluster-template --load-restrictor LoadRestrictionsNone > $(K0SMOTRON_TEMPLATES)/main/cluster-template.yaml
130134

131135

132136
e2e: generate-e2e-templates-main
@@ -135,6 +139,7 @@ e2e: generate-e2e-templates-main
135139
-artifacts-folder="$(ARTIFACTS)" \
136140
-config="$(E2E_CONF_FILE)" \
137141
-skip-resource-cleanup=$(SKIP_RESOURCE_CLEANUP) \
142+
-infrastructure-provider=$(E2E_INFRASTRUCTURE_PROVIDER) \
138143
-timeout=30m
139144

140145
e2e-aws:
@@ -143,7 +148,7 @@ e2e-aws:
143148
@[ -n "$$AWS_REGION" ] || (echo "AWS_REGION not defined"; exit 1)
144149
@[ -n "$$AWS_B64ENCODED_CREDENTIALS" ] || (echo "AWS_B64ENCODED_CREDENTIALS not defined"; exit 1)
145150
@[ -n "$$SSH_PUBLIC_KEY" ] || (echo "SSH_PUBLIC_KEY not defined"; exit 1)
146-
$(MAKE) e2e TEST_NAME="${TEST_NAME}" E2E_CONF_FILE="$(shell pwd)/e2e/config/aws.yaml"
151+
$(MAKE) e2e TEST_NAME="${TEST_NAME}" E2E_INFRASTRUCTURE_PROVIDER=aws
147152

148153
##@ Build
149154

docs/contributing/release-process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ You can verify the documentation at https://docs.k0smotron.io/ after the workflo
5757
If you are making a new **major** or **minor** release, after publishing the release, update the E2E upgrade test to reflect the new release version:
5858

5959
- Add new release in `k0smotronMinorVersionsToCheckUpgrades` in [`e2e/k0smotron_upgrade_test.go`](https://github.com/k0sproject/k0smotron/blob/main/e2e/k0smotron_upgrade_test.go).
60-
- Add the new release entry under the `k0sproject-k0smotron` provider in [`e2e/config/docker.yaml`](https://github.com/k0sproject/k0smotron/blob/main/e2e/config/docker.yaml) (including matching `control-plane-components.yaml` and `bootstrap-components.yaml` URLs).
60+
- Add the new release entry under the `k0sproject-k0smotron` provider in [`e2e/config.yaml`](https://github.com/k0sproject/k0smotron/blob/main/e2e/config.yaml) (including matching `control-plane-components.yaml` and `bootstrap-components.yaml` URLs).

e2e/admission_webhook_test.go

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ func admissionWebhookRecreateStrategyInSingleModeSpec(t *testing.T) {
5555
Namespace: namespace.Name,
5656
ClusterName: clusterName,
5757
KubernetesVersion: e2eConfig.MustGetVariable(KubernetesVersion),
58-
ControlPlaneMachineCount: ptr.To[int64](3),
59-
// TODO: make infra provider configurable
60-
InfrastructureProvider: "docker",
61-
LogFolder: filepath.Join(artifactFolder, "clusters", bootstrapClusterProxy.GetName()),
58+
ControlPlaneMachineCount: ptr.To(int64(controlPlaneMachineCount)),
59+
WorkerMachineCount: ptr.To(int64(workerMachineCount)),
60+
InfrastructureProvider: infrastructureProvider,
61+
LogFolder: filepath.Join(artifactFolder, "clusters", bootstrapClusterProxy.GetName()),
6262
ClusterctlVariables: map[string]string{
6363
"CLUSTER_NAME": clusterName,
6464
"NAMESPACE": namespace.Name,
@@ -80,18 +80,16 @@ func admissionWebhookK0sVersionNotCompatibleSpec(t *testing.T) {
8080
clusterName := fmt.Sprintf("%s-%s", testName, capiutil.RandomString(6))
8181

8282
workloadClusterTemplate := clusterctl.ConfigCluster(ctx, clusterctl.ConfigClusterInput{
83-
ClusterctlConfigPath: clusterctlConfigPath,
84-
KubeconfigPath: bootstrapClusterProxy.GetKubeconfigPath(),
85-
// select cluster templates
86-
Flavor: "webhook-k0s-not-compatible",
87-
83+
ClusterctlConfigPath: clusterctlConfigPath,
84+
KubeconfigPath: bootstrapClusterProxy.GetKubeconfigPath(),
85+
Flavor: "webhook-k0s-not-compatible",
8886
Namespace: namespace.Name,
8987
ClusterName: clusterName,
9088
KubernetesVersion: e2eConfig.MustGetVariable(KubernetesVersion),
91-
ControlPlaneMachineCount: ptr.To[int64](3),
92-
// TODO: make infra provider configurable
93-
InfrastructureProvider: "docker",
94-
LogFolder: filepath.Join(artifactFolder, "clusters", bootstrapClusterProxy.GetName()),
89+
ControlPlaneMachineCount: ptr.To(int64(controlPlaneMachineCount)),
90+
WorkerMachineCount: ptr.To(int64(workerMachineCount)),
91+
InfrastructureProvider: infrastructureProvider,
92+
LogFolder: filepath.Join(artifactFolder, "clusters", bootstrapClusterProxy.GetName()),
9593
ClusterctlVariables: map[string]string{
9694
"CLUSTER_NAME": clusterName,
9795
"NAMESPACE": namespace.Name,

e2e/config/docker.yaml renamed to e2e/config.yaml

Lines changed: 56 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# - cluster-api
44
# - bootstrap k0smotron
55
# - control-plane k0smotron
6-
# - infrastructure docker
6+
# - infrastructure docker, aws, k0sproject-k0smotron
77
images:
88
- name: quay.io/k0sproject/k0smotron:latest
99
loadBehavior: mustLoad
@@ -17,10 +17,25 @@ providers:
1717
type: url
1818
contract: v1beta1
1919
files:
20-
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
20+
- sourcePath: "./data/shared/v1beta1/metadata.yaml"
2121
replacements:
2222
- old: "imagePullPolicy: Always"
2323
new: "imagePullPolicy: IfNotPresent"
24+
- name: k0sproject-k0smotron
25+
type: InfrastructureProvider
26+
versions:
27+
- name: v1.9.99 # potentially next release. Manifest from source files (development) are used.
28+
value: ../config/default
29+
contract: v1beta1
30+
files:
31+
- sourcePath: "../metadata.yaml"
32+
replacements:
33+
- old: "imagePullPolicy: Always"
34+
new: "imagePullPolicy: IfNotPresent"
35+
- old: "image: k0s/k0smotron:latest"
36+
new: "image: quay.io/k0sproject/k0smotron:latest" # For local testing, this image needs to be built before run e2e by using `make docker-build`
37+
files:
38+
- sourcePath: "./data/infrastructure-k0smotron/main/cluster-template.yaml"
2439
- name: docker
2540
type: InfrastructureProvider
2641
versions:
@@ -29,18 +44,31 @@ providers:
2944
type: url
3045
contract: v1beta1
3146
files:
32-
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
47+
- sourcePath: "./data/shared/v1beta1/metadata.yaml"
48+
replacements:
49+
- old: "imagePullPolicy: Always"
50+
new: "imagePullPolicy: IfNotPresent"
51+
files:
52+
- sourcePath: "./data/infrastructure-docker/main/cluster-template.yaml"
53+
- sourcePath: "./data/infrastructure-docker/main/cluster-template-kcp-remediation.yaml"
54+
- sourcePath: "./data/infrastructure-docker/main/cluster-template-webhook-recreate-in-single-mode.yaml"
55+
- sourcePath: "./data/infrastructure-docker/main/cluster-template-webhook-k0s-not-compatible.yaml"
56+
- sourcePath: "./data/infrastructure-docker/main/cluster-template-machinedeployment.yaml"
57+
- sourcePath: "./data/infrastructure-docker/main/cluster-template-remote-hcp.yaml"
58+
- name: aws
59+
type: InfrastructureProvider
60+
versions:
61+
- name: v2.9.0
62+
value: "https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/download/v2.9.0/infrastructure-components.yaml"
63+
type: url
64+
contract: v1beta1
65+
files:
66+
- sourcePath: ".data.yaml"
3367
replacements:
3468
- old: "imagePullPolicy: Always"
3569
new: "imagePullPolicy: IfNotPresent"
3670
files:
37-
- sourcePath: "../data/infrastructure-docker/main/cluster-template.yaml"
38-
- sourcePath: "../data/infrastructure-docker/main/cluster-template-kcp-remediation.yaml"
39-
- sourcePath: "../data/infrastructure-docker/main/cluster-template-webhook-recreate-in-single-mode.yaml"
40-
- sourcePath: "../data/infrastructure-docker/main/cluster-template-webhook-k0s-not-compatible.yaml"
41-
- sourcePath: "../data/infrastructure-docker/main/cluster-template-machinedeployment.yaml"
42-
- sourcePath: "../data/infrastructure-docker/main/cluster-template-remote-hcp.yaml"
43-
- sourcePath: "../data/infrastructure-docker/main/cluster-template-ingress.yaml"
71+
- sourcePath: "./data/infrastructure-aws/cluster-template-ignition.yaml"
4472
- name: k0sproject-k0smotron
4573
type: ControlPlaneProvider
4674
versions:
@@ -49,7 +77,7 @@ providers:
4977
type: url
5078
contract: v1beta1
5179
files:
52-
- sourcePath: "../../metadata.yaml"
80+
- sourcePath: "../metadata.yaml"
5381
replacements:
5482
- old: "imagePullPolicy: Always"
5583
new: "imagePullPolicy: IfNotPresent"
@@ -58,7 +86,7 @@ providers:
5886
type: url
5987
contract: v1beta1
6088
files:
61-
- sourcePath: "../../metadata.yaml"
89+
- sourcePath: "../metadata.yaml"
6290
replacements:
6391
- old: "imagePullPolicy: Always"
6492
new: "imagePullPolicy: IfNotPresent"
@@ -67,7 +95,7 @@ providers:
6795
type: url
6896
contract: v1beta1
6997
files:
70-
- sourcePath: "../../metadata.yaml"
98+
- sourcePath: "../metadata.yaml"
7199
replacements:
72100
- old: "imagePullPolicy: Always"
73101
new: "imagePullPolicy: IfNotPresent"
@@ -76,7 +104,7 @@ providers:
76104
type: url
77105
contract: v1beta1
78106
files:
79-
- sourcePath: "../../metadata.yaml"
107+
- sourcePath: "../metadata.yaml"
80108
replacements:
81109
- old: "imagePullPolicy: Always"
82110
new: "imagePullPolicy: IfNotPresent"
@@ -85,15 +113,15 @@ providers:
85113
type: url
86114
contract: v1beta1
87115
files:
88-
- sourcePath: "../../metadata.yaml"
116+
- sourcePath: "../metadata.yaml"
89117
replacements:
90118
- old: "imagePullPolicy: Always"
91119
new: "imagePullPolicy: IfNotPresent"
92120
- name: v1.9.99 # potentially next release. Manifest from source files (development) are used.
93-
value: ../../config/default
121+
value: ../config/default
94122
contract: v1beta1
95123
files:
96-
- sourcePath: "../../metadata.yaml"
124+
- sourcePath: "../metadata.yaml"
97125
replacements:
98126
- old: "imagePullPolicy: Always"
99127
new: "imagePullPolicy: IfNotPresent"
@@ -107,7 +135,7 @@ providers:
107135
type: url
108136
contract: v1beta1
109137
files:
110-
- sourcePath: "../../metadata.yaml"
138+
- sourcePath: "../metadata.yaml"
111139
replacements:
112140
- old: "imagePullPolicy: Always"
113141
new: "imagePullPolicy: IfNotPresent"
@@ -116,7 +144,7 @@ providers:
116144
type: url
117145
contract: v1beta1
118146
files:
119-
- sourcePath: "../../metadata.yaml"
147+
- sourcePath: "../metadata.yaml"
120148
replacements:
121149
- old: "imagePullPolicy: Always"
122150
new: "imagePullPolicy: IfNotPresent"
@@ -125,7 +153,7 @@ providers:
125153
type: url
126154
contract: v1beta1
127155
files:
128-
- sourcePath: "../../metadata.yaml"
156+
- sourcePath: "../metadata.yaml"
129157
replacements:
130158
- old: "imagePullPolicy: Always"
131159
new: "imagePullPolicy: IfNotPresent"
@@ -134,7 +162,7 @@ providers:
134162
type: url
135163
contract: v1beta1
136164
files:
137-
- sourcePath: "../../metadata.yaml"
165+
- sourcePath: "../metadata.yaml"
138166
replacements:
139167
- old: "imagePullPolicy: Always"
140168
new: "imagePullPolicy: IfNotPresent"
@@ -143,15 +171,15 @@ providers:
143171
type: url
144172
contract: v1beta1
145173
files:
146-
- sourcePath: "../../metadata.yaml"
174+
- sourcePath: "../metadata.yaml"
147175
replacements:
148176
- old: "imagePullPolicy: Always"
149177
new: "imagePullPolicy: IfNotPresent"
150178
- name: v1.9.99 # potentially next release. Manifest from source files (development) are used.
151-
value: ../../config/default
179+
value: ../config/default
152180
contract: v1beta1
153181
files:
154-
- sourcePath: "../../metadata.yaml"
182+
- sourcePath: "../metadata.yaml"
155183
replacements:
156184
- old: "imagePullPolicy: Always"
157185
new: "imagePullPolicy: IfNotPresent"
@@ -161,8 +189,9 @@ providers:
161189
variables:
162190
KUBERNETES_VERSION_MANAGEMENT: "v1.30.0"
163191
KUBERNETES_VERSION: "v1.31.0"
164-
KUBERNETES_VERSION_FIRST_UPGRADE_TO: "v1.30.2+k0s.0"
165-
KUBERNETES_VERSION_SECOND_UPGRADE_TO: "v1.31.2+k0s.0"
192+
K0S_VERSION: "v1.30.1+k0s.0"
193+
K0S_VERSION_FIRST_UPGRADE_TO: "v1.30.2+k0s.0"
194+
K0S_VERSION_SECOND_UPGRADE_TO: "v1.31.2+k0s.0"
166195
IP_FAMILY: "IPv4"
167196
KIND_IMAGE_VERSION: "v1.30.0"
168197
# Enabling the feature flags by setting the env variables.
@@ -183,7 +212,6 @@ intervals:
183212
default/wait-nodes-ready: ["10m", "10s"]
184213
default/wait-machine-remediation: ["5m", "10s"]
185214
default/wait-autoscaler: ["5m", "10s"]
186-
ingress/wait-controllers: ["5m", "10s"]
187215
remote-hcp/wait-controllers: ["5m", "10s"]
188216
bootstrap/wait-deployment-available: ["3m", "10s"]
189217
node-drain/wait-deployment-available: ["3m", "10s"]
@@ -193,6 +221,7 @@ intervals:
193221
workload-recreate-upgrade/wait-cluster: ["10m", "10s"]
194222
workload-recreate-upgrade/wait-control-plane: ["20m", "10s"]
195223
workload-recreate-upgrade/wait-worker-nodes: ["20m", "10s"]
224+
workload-inplace-upgrade/wait-controllers: ["10m", "20s"]
196225
workload-inplace-upgrade/wait-cluster: ["10m", "10s"]
197226
workload-inplace-upgrade/wait-control-plane: ["20m", "10s"]
198227
workload-inplace-upgrade/wait-worker-nodes: ["20m", "10s"]

0 commit comments

Comments
 (0)