Skip to content

Commit 7eeca5d

Browse files
committed
Implement single-node cluster self-hosted upgrade test
1 parent 324f8e8 commit 7eeca5d

File tree

6 files changed

+54
-0
lines changed

6 files changed

+54
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,7 @@ generate-e2e-templates-v1beta1: $(KUSTOMIZE)
12091209
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-upgrades-runtimesdk --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-upgrades-runtimesdk.yaml
12101210
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-kcp-scale-in --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-kcp-scale-in.yaml
12111211
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-ipv6 --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-ipv6.yaml
1212+
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-topology-single-node-cluster --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-topology-single-node-cluster.yaml
12121213
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-topology.yaml
12131214
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-ignition --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-ignition.yaml
12141215

test/e2e/config/docker.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ providers:
195195
- sourcePath: "../data/infrastructure-docker/v1beta1/main/cluster-template-upgrades-runtimesdk.yaml"
196196
- sourcePath: "../data/infrastructure-docker/v1beta1/main/cluster-template-kcp-scale-in.yaml"
197197
- sourcePath: "../data/infrastructure-docker/v1beta1/main/cluster-template-ipv6.yaml"
198+
- sourcePath: "../data/infrastructure-docker/v1beta1/main/cluster-template-topology-single-node-cluster.yaml"
198199
- sourcePath: "../data/infrastructure-docker/v1beta1/main/cluster-template-topology.yaml"
199200
- sourcePath: "../data/infrastructure-docker/v1beta1/main/cluster-template-ignition.yaml"
200201
- sourcePath: "../data/infrastructure-docker/v1beta1/main/clusterclass-quick-start.yaml"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- op: add
2+
path: /spec/topology/variables/-
3+
value:
4+
name: controlPlaneTaint
5+
value: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
resources:
2+
- ../bases/cluster-with-topology.yaml
3+
- ../bases/crs.yaml
4+
5+
patches:
6+
- path: disable-control-plane-taint-variable.yaml
7+
target:
8+
group: cluster.x-k8s.io
9+
version: v1beta1
10+
kind: Cluster
11+

test/e2e/data/infrastructure-docker/v1beta1/main/clusterclass-quick-start.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ spec:
8484
items:
8585
type: string
8686
description: "preLoadImages sets the images for the docker machines to preload."
87+
- name: controlPlaneTaint
88+
required: false
89+
schema:
90+
openAPIV3Schema:
91+
type: boolean
92+
default: true
8793
patches:
8894
- name: lbImageRepository
8995
definitions:
@@ -225,6 +231,21 @@ spec:
225231
path: /spec/template/spec/rolloutStrategy/rollingUpdate/maxSurge
226232
valueFrom:
227233
template: "{{ .kubeadmControlPlaneMaxSurge }}"
234+
- name: controlPlaneTaint
235+
enabledIf: "{{ not .controlPlaneTaint }}"
236+
definitions:
237+
- selector:
238+
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
239+
kind: KubeadmControlPlaneTemplate
240+
matchResources:
241+
controlPlane: true
242+
jsonPatches:
243+
- op: add
244+
path: "/spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/taints"
245+
value: []
246+
- op: add
247+
path: "/spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/taints"
248+
value: []
228249
---
229250
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
230251
kind: DockerClusterTemplate

test/e2e/self_hosted_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,18 @@ var _ = Describe("When testing Cluster API working on self-hosted clusters using
6565
}
6666
})
6767
})
68+
69+
var _ = Describe("When testing Cluster API working on single-node self-hosted clusters using ClusterClass [ClusterClass]", func() {
70+
SelfHostedSpec(ctx, func() SelfHostedSpecInput {
71+
return SelfHostedSpecInput{
72+
E2EConfig: e2eConfig,
73+
ClusterctlConfigPath: clusterctlConfigPath,
74+
BootstrapClusterProxy: bootstrapClusterProxy,
75+
ArtifactFolder: artifactFolder,
76+
SkipCleanup: skipCleanup,
77+
Flavor: "topology-single-node-cluster",
78+
ControlPlaneMachineCount: pointer.Int64Ptr(1),
79+
WorkerMachineCount: pointer.Int64Ptr(0),
80+
}
81+
})
82+
})

0 commit comments

Comments
 (0)