Skip to content

Commit

Permalink
Merge pull request #7387 from chrischdi/pr-test-snc-self-hosted-upgrade
Browse files Browse the repository at this point in the history
🌱 Implement single-node cluster self-hosted upgrade test
  • Loading branch information
k8s-ci-robot authored Oct 12, 2022
2 parents efb7e86 + 7eeca5d commit 2ddef5c
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions test/e2e/config/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- op: add
path: /spec/topology/variables/-
value:
name: controlPlaneTaint
value: false
Original file line number Diff line number Diff line change
@@ -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

Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions test/e2e/self_hosted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
})
})

0 comments on commit 2ddef5c

Please sign in to comment.