diff --git a/Makefile b/Makefile index 04250dcda5c5..5b961bd6835d 100644 --- a/Makefile +++ b/Makefile @@ -1185,6 +1185,7 @@ generate-e2e-templates-v1beta1: $(KUSTOMIZE) $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-upgrades-runtimesdk --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-upgrades-runtimesdk.yaml $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-kcp-scale-in --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-kcp-scale-in.yaml $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-ipv6 --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-ipv6.yaml + $(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 $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-topology.yaml $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-ignition --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1beta1/main/cluster-template-ignition.yaml diff --git a/test/e2e/config/docker.yaml b/test/e2e/config/docker.yaml index 98f84a96b24d..ef35aecd7d26 100644 --- a/test/e2e/config/docker.yaml +++ b/test/e2e/config/docker.yaml @@ -195,6 +195,7 @@ providers: - sourcePath: "../data/infrastructure-docker/v1beta1/main/cluster-template-upgrades-runtimesdk.yaml" - sourcePath: "../data/infrastructure-docker/v1beta1/main/cluster-template-kcp-scale-in.yaml" - sourcePath: "../data/infrastructure-docker/v1beta1/main/cluster-template-ipv6.yaml" + - sourcePath: "../data/infrastructure-docker/v1beta1/main/cluster-template-topology-single-node-cluster.yaml" - sourcePath: "../data/infrastructure-docker/v1beta1/main/cluster-template-topology.yaml" - sourcePath: "../data/infrastructure-docker/v1beta1/main/cluster-template-ignition.yaml" - sourcePath: "../data/infrastructure-docker/v1beta1/main/clusterclass-quick-start.yaml" diff --git a/test/e2e/data/infrastructure-docker/v1beta1/main/cluster-template-topology-single-node-cluster/disable-control-plane-taint-variable.yaml b/test/e2e/data/infrastructure-docker/v1beta1/main/cluster-template-topology-single-node-cluster/disable-control-plane-taint-variable.yaml new file mode 100644 index 000000000000..5de41102dfa6 --- /dev/null +++ b/test/e2e/data/infrastructure-docker/v1beta1/main/cluster-template-topology-single-node-cluster/disable-control-plane-taint-variable.yaml @@ -0,0 +1,5 @@ +- op: add + path: /spec/topology/variables/- + value: + name: controlPlaneTaint + value: false diff --git a/test/e2e/data/infrastructure-docker/v1beta1/main/cluster-template-topology-single-node-cluster/kustomization.yaml b/test/e2e/data/infrastructure-docker/v1beta1/main/cluster-template-topology-single-node-cluster/kustomization.yaml new file mode 100644 index 000000000000..2754bfff6339 --- /dev/null +++ b/test/e2e/data/infrastructure-docker/v1beta1/main/cluster-template-topology-single-node-cluster/kustomization.yaml @@ -0,0 +1,11 @@ +resources: + - ../bases/cluster-with-topology.yaml + - ../bases/crs.yaml + +patches: +- path: disable-control-plane-taint-variable.yaml + target: + group: cluster.x-k8s.io + version: v1beta1 + kind: Cluster + diff --git a/test/e2e/data/infrastructure-docker/v1beta1/main/clusterclass-quick-start.yaml b/test/e2e/data/infrastructure-docker/v1beta1/main/clusterclass-quick-start.yaml index 0825791fc90e..828bc6f616cd 100644 --- a/test/e2e/data/infrastructure-docker/v1beta1/main/clusterclass-quick-start.yaml +++ b/test/e2e/data/infrastructure-docker/v1beta1/main/clusterclass-quick-start.yaml @@ -84,6 +84,12 @@ spec: items: type: string description: "preLoadImages sets the images for the docker machines to preload." + - name: controlPlaneTaint + required: false + schema: + openAPIV3Schema: + type: boolean + default: true patches: - name: lbImageRepository definitions: @@ -225,6 +231,21 @@ spec: path: /spec/template/spec/rolloutStrategy/rollingUpdate/maxSurge valueFrom: template: "{{ .kubeadmControlPlaneMaxSurge }}" + - name: controlPlaneTaint + enabledIf: "{{ not .controlPlaneTaint }}" + definitions: + - selector: + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 + kind: KubeadmControlPlaneTemplate + matchResources: + controlPlane: true + jsonPatches: + - op: add + path: "/spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/taints" + value: [] + - op: add + path: "/spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/taints" + value: [] --- apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: DockerClusterTemplate diff --git a/test/e2e/self_hosted_test.go b/test/e2e/self_hosted_test.go index 8ed731858764..a048138d5a0c 100644 --- a/test/e2e/self_hosted_test.go +++ b/test/e2e/self_hosted_test.go @@ -65,3 +65,18 @@ var _ = Describe("When testing Cluster API working on self-hosted clusters using } }) }) + +var _ = Describe("When testing Cluster API working on single-node self-hosted clusters using ClusterClass [ClusterClass]", func() { + SelfHostedSpec(ctx, func() SelfHostedSpecInput { + return SelfHostedSpecInput{ + E2EConfig: e2eConfig, + ClusterctlConfigPath: clusterctlConfigPath, + BootstrapClusterProxy: bootstrapClusterProxy, + ArtifactFolder: artifactFolder, + SkipCleanup: skipCleanup, + Flavor: "topology-single-node-cluster", + ControlPlaneMachineCount: pointer.Int64Ptr(1), + WorkerMachineCount: pointer.Int64Ptr(0), + } + }) +})