diff --git a/Makefile b/Makefile index 521cb675dcb1..9fa7470b8e0f 100644 --- a/Makefile +++ b/Makefile @@ -504,7 +504,7 @@ generate-modules: ## Run go mod tidy to ensure modules are up to date cd $(TEST_DIR); go mod tidy .PHONY: generate-e2e-templates -generate-e2e-templates: $(KUSTOMIZE) $(addprefix generate-e2e-templates-, v1.0 v1.3 v1.4 main) ## Generate cluster templates for all versions +generate-e2e-templates: $(KUSTOMIZE) $(addprefix generate-e2e-templates-, v1.0 v1.4 v1.5 main) ## Generate cluster templates for all versions DOCKER_TEMPLATES := test/e2e/data/infrastructure-docker INMEMORY_TEMPLATES := test/e2e/data/infrastructure-inmemory @@ -513,16 +513,16 @@ INMEMORY_TEMPLATES := test/e2e/data/infrastructure-inmemory generate-e2e-templates-v1.0: $(KUSTOMIZE) $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.0/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.0/cluster-template.yaml -.PHONY: generate-e2e-templates-v1.3 -generate-e2e-templates-v1.3: $(KUSTOMIZE) - $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.3/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.3/cluster-template.yaml - $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.3/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.3/cluster-template-topology.yaml - .PHONY: generate-e2e-templates-v1.4 generate-e2e-templates-v1.4: $(KUSTOMIZE) $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.4/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.4/cluster-template.yaml $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.4/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.4/cluster-template-topology.yaml +.PHONY: generate-e2e-templates-v1.5 +generate-e2e-templates-v1.5: $(KUSTOMIZE) + $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.5/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.5/cluster-template.yaml + $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.5/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.5/cluster-template-topology.yaml + .PHONY: generate-e2e-templates-main generate-e2e-templates-main: $(KUSTOMIZE) $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template.yaml diff --git a/cmd/clusterctl/hack/create-local-repository.py b/cmd/clusterctl/hack/create-local-repository.py index c99d5753f4f3..41bc8403a356 100755 --- a/cmd/clusterctl/hack/create-local-repository.py +++ b/cmd/clusterctl/hack/create-local-repository.py @@ -52,36 +52,36 @@ providers = { 'cluster-api': { 'componentsFile': 'core-components.yaml', - 'nextVersion': 'v1.5.99', + 'nextVersion': 'v1.6.99', 'type': 'CoreProvider', }, 'bootstrap-kubeadm': { 'componentsFile': 'bootstrap-components.yaml', - 'nextVersion': 'v1.5.99', + 'nextVersion': 'v1.6.99', 'type': 'BootstrapProvider', 'configFolder': 'bootstrap/kubeadm/config/default', }, 'control-plane-kubeadm': { 'componentsFile': 'control-plane-components.yaml', - 'nextVersion': 'v1.5.99', + 'nextVersion': 'v1.6.99', 'type': 'ControlPlaneProvider', 'configFolder': 'controlplane/kubeadm/config/default', }, 'infrastructure-docker': { 'componentsFile': 'infrastructure-components.yaml', - 'nextVersion': 'v1.5.99', + 'nextVersion': 'v1.6.99', 'type': 'InfrastructureProvider', 'configFolder': 'test/infrastructure/docker/config/default', }, 'infrastructure-in-memory': { 'componentsFile': 'infrastructure-components.yaml', - 'nextVersion': 'v1.5.99', + 'nextVersion': 'v1.6.99', 'type': 'InfrastructureProvider', 'configFolder': 'test/infrastructure/inmemory/config/default', }, 'runtime-extension-test': { 'componentsFile': 'runtime-extension-components.yaml', - 'nextVersion': 'v1.5.99', + 'nextVersion': 'v1.6.99', 'type': 'RuntimeExtensionProvider', 'configFolder': 'test/extension/config/default', }, diff --git a/docs/release/release-tasks.md b/docs/release/release-tasks.md index b3f0a30679f8..ccc7760af0b2 100644 --- a/docs/release/release-tasks.md +++ b/docs/release/release-tasks.md @@ -108,7 +108,8 @@ This comes down to changing occurrences of the old version to the new version, e 1. Create a new `v1.4` `metadata.yaml` (`test/e2e/data/shared/v1.4/metadata.yaml`) by copying `test/e2e/data/shared/main/metadata.yaml` 2. Add the new release to the main `metadata.yaml` (`test/e2e/data/shared/main/metadata.yaml`). - 3. Remove old `metadata.yaml`'s that are not used anymore in clusterctl upgrade tests. + 3. Add the new release to the root level `metadata.yaml` + 4. Remove old `metadata.yaml`'s that are not used anymore in clusterctl upgrade tests. 4. Adjust cluster templates in `test/e2e/data/infrastructure-docker`: 1. Create a new `v1.4` folder. It should be created based on the `main` folder and only contain the templates we use in the clusterctl upgrade tests (as of today `cluster-template` and `cluster-template-topology`). @@ -119,8 +120,8 @@ This comes down to changing occurrences of the old version to the new version, e 3. Make sure all tests are green (also run `pull-cluster-api-e2e-full-main` and `pull-cluster-api-e2e-workload-upgrade-1-23-latest-main`). Prior art: -- 1.3 - https://github.com/kubernetes-sigs/cluster-api/pull/6834/files - 1.4 - https://github.com/kubernetes-sigs/cluster-api/pull/7692/files +- 1.5 - https://github.com/kubernetes-sigs/cluster-api/pull/8430/files #### Create a new GitHub milestone for the next release diff --git a/hack/tools/tilt-prepare/main.go b/hack/tools/tilt-prepare/main.go index 5be7f25bbc22..bdd45d13c9b1 100644 --- a/hack/tools/tilt-prepare/main.go +++ b/hack/tools/tilt-prepare/main.go @@ -70,7 +70,7 @@ const ( var ( // Defines the default version to be used for the provider CR if no version is specified in the tilt-provider.yaml|json file. - defaultProviderVersion = "v1.5.99" + defaultProviderVersion = "v1.6.99" // This data struct mirrors a subset of info from the providers struct in the tilt file // which is containing "hard-coded" tilt-provider.yaml files for the providers managed in the Cluster API repository. diff --git a/metadata.yaml b/metadata.yaml index 49d96b1c0106..de46d5e8fb0e 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -6,6 +6,9 @@ apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3 kind: Metadata releaseSeries: + - major: 1 + minor: 6 + contract: v1beta1 - major: 1 minor: 5 contract: v1beta1 diff --git a/test/e2e/clusterctl_upgrade_test.go b/test/e2e/clusterctl_upgrade_test.go index 2a1b7bdeaf02..8ad7929f221d 100644 --- a/test/e2e/clusterctl_upgrade_test.go +++ b/test/e2e/clusterctl_upgrade_test.go @@ -66,7 +66,7 @@ var _ = Describe("When testing clusterctl upgrades (v1.0=>current)", func() { }) }) -var _ = Describe("When testing clusterctl upgrades (v1.3=>current)", func() { +var _ = Describe("When testing clusterctl upgrades (v1.4=>current)", func() { ClusterctlUpgradeSpec(ctx, func() ClusterctlUpgradeSpecInput { return ClusterctlUpgradeSpecInput{ E2EConfig: e2eConfig, @@ -75,21 +75,21 @@ var _ = Describe("When testing clusterctl upgrades (v1.3=>current)", func() { ArtifactFolder: artifactFolder, SkipCleanup: skipCleanup, InfrastructureProvider: pointer.String("docker"), - InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.3.6/clusterctl-{OS}-{ARCH}", + InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.5/clusterctl-{OS}-{ARCH}", // We have to pin the providers because with `InitWithProvidersContract` the test would - // use the latest version for the contract (which is v1.4.X for v1beta1). - InitWithCoreProvider: "cluster-api:v1.3.6", - InitWithBootstrapProviders: []string{"kubeadm:v1.3.6"}, - InitWithControlPlaneProviders: []string{"kubeadm:v1.3.6"}, - InitWithInfrastructureProviders: []string{"docker:v1.3.6"}, - // We have to set this to an empty array as clusterctl v1.3 doesn't support + // use the latest version for the contract (which is v1.5.X for v1beta1). + InitWithCoreProvider: "cluster-api:v1.4.5", + InitWithBootstrapProviders: []string{"kubeadm:v1.4.5"}, + InitWithControlPlaneProviders: []string{"kubeadm:v1.4.5"}, + InitWithInfrastructureProviders: []string{"docker:v1.4.5"}, + // We have to set this to an empty array as clusterctl v1.4 doesn't support // runtime extension providers. If we don't do this the test will automatically // try to deploy the latest version of our test-extension from docker.yaml. InitWithRuntimeExtensionProviders: []string{}, InitWithProvidersContract: "v1beta1", - // NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/data/infrastructure-docker/v1.3/bases. - InitWithKubernetesVersion: "v1.26.4", - WorkloadKubernetesVersion: "v1.26.4", + // NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/e2e/data/infrastructure-docker/v1.4/bases. + InitWithKubernetesVersion: "v1.27.3", + WorkloadKubernetesVersion: "v1.27.3", MgmtFlavor: "topology", WorkloadFlavor: "", // This check ensures that ownerReference apiVersions are updated for all types after the upgrade. @@ -107,7 +107,7 @@ var _ = Describe("When testing clusterctl upgrades (v1.3=>current)", func() { }) }) -var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.3=>current) [ClusterClass]", func() { +var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.4=>current) [ClusterClass]", func() { ClusterctlUpgradeSpec(ctx, func() ClusterctlUpgradeSpecInput { return ClusterctlUpgradeSpecInput{ E2EConfig: e2eConfig, @@ -116,21 +116,21 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.3=>cur ArtifactFolder: artifactFolder, SkipCleanup: skipCleanup, InfrastructureProvider: pointer.String("docker"), - InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.3.6/clusterctl-{OS}-{ARCH}", + InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.5/clusterctl-{OS}-{ARCH}", // We have to pin the providers because with `InitWithProvidersContract` the test would - // use the latest version for the contract (which is v1.4.X for v1beta1). - InitWithCoreProvider: "cluster-api:v1.3.6", - InitWithBootstrapProviders: []string{"kubeadm:v1.3.6"}, - InitWithControlPlaneProviders: []string{"kubeadm:v1.3.6"}, - InitWithInfrastructureProviders: []string{"docker:v1.3.6"}, - // We have to set this to an empty array as clusterctl v1.3 doesn't support + // use the latest version for the contract (which is v1.5.X for v1beta1). + InitWithCoreProvider: "cluster-api:v1.4.5", + InitWithBootstrapProviders: []string{"kubeadm:v1.4.5"}, + InitWithControlPlaneProviders: []string{"kubeadm:v1.4.5"}, + InitWithInfrastructureProviders: []string{"docker:v1.4.5"}, + // We have to set this to an empty array as clusterctl v1.4 doesn't support // runtime extension providers. If we don't do this the test will automatically // try to deploy the latest version of our test-extension from docker.yaml. InitWithRuntimeExtensionProviders: []string{}, InitWithProvidersContract: "v1beta1", - // NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/data/infrastructure-docker/v1.3/bases. - InitWithKubernetesVersion: "v1.26.4", - WorkloadKubernetesVersion: "v1.26.4", + // NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/e2e/data/infrastructure-docker/v1.4/bases. + InitWithKubernetesVersion: "v1.27.3", + WorkloadKubernetesVersion: "v1.27.3", MgmtFlavor: "topology", WorkloadFlavor: "topology", // This check ensures that ownerReference apiVersions are updated for all types after the upgrade. @@ -148,7 +148,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.3=>cur }) }) -var _ = Describe("When testing clusterctl upgrades (v1.4=>current)", func() { +var _ = Describe("When testing clusterctl upgrades (v1.5=>current)", func() { ClusterctlUpgradeSpec(ctx, func() ClusterctlUpgradeSpecInput { return ClusterctlUpgradeSpecInput{ E2EConfig: e2eConfig, @@ -157,9 +157,9 @@ var _ = Describe("When testing clusterctl upgrades (v1.4=>current)", func() { ArtifactFolder: artifactFolder, SkipCleanup: skipCleanup, InfrastructureProvider: pointer.String("docker"), - InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.0/clusterctl-{OS}-{ARCH}", + InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.0/clusterctl-{OS}-{ARCH}", InitWithProvidersContract: "v1beta1", - // NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/data/infrastructure-docker/v1.4/bases. + // NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/e2e/data/infrastructure-docker/v1.5/bases. InitWithKubernetesVersion: "v1.27.3", WorkloadKubernetesVersion: "v1.27.3", MgmtFlavor: "topology", @@ -179,7 +179,7 @@ var _ = Describe("When testing clusterctl upgrades (v1.4=>current)", func() { }) }) -var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.4=>current) [ClusterClass]", func() { +var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.5=>current) [ClusterClass]", func() { ClusterctlUpgradeSpec(ctx, func() ClusterctlUpgradeSpecInput { return ClusterctlUpgradeSpecInput{ E2EConfig: e2eConfig, @@ -188,9 +188,9 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.4=>cur ArtifactFolder: artifactFolder, SkipCleanup: skipCleanup, InfrastructureProvider: pointer.String("docker"), - InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.0/clusterctl-{OS}-{ARCH}", + InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.0/clusterctl-{OS}-{ARCH}", InitWithProvidersContract: "v1beta1", - // NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/data/infrastructure-docker/v1.4/bases. + // NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/e2e/data/infrastructure-docker/v1.5/bases. InitWithKubernetesVersion: "v1.27.3", WorkloadKubernetesVersion: "v1.27.3", MgmtFlavor: "topology", diff --git a/test/e2e/config/docker.yaml b/test/e2e/config/docker.yaml index dc11eb281596..6475029700d3 100644 --- a/test/e2e/config/docker.yaml +++ b/test/e2e/config/docker.yaml @@ -44,25 +44,25 @@ providers: new: --metrics-addr=:8080 files: - sourcePath: "../data/shared/v1.0/metadata.yaml" - - name: v1.3.6 # supported release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.3.6/core-components.yaml" + - name: v1.4.5 # supported release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.5/core-components.yaml" type: "url" contract: v1beta1 replacements: - - old: --metrics-addr=127.0.0.1:8080 - new: --metrics-addr=:8080 + - old: --metrics-addr=127.0.0.1:8080 + new: --metrics-addr=:8080 files: - - sourcePath: "../data/shared/v1.3/metadata.yaml" - - name: v1.4.0 # latest published release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.0/core-components.yaml" + - sourcePath: "../data/shared/v1.4/metadata.yaml" + - name: v1.5.0 # latest published release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.0/core-components.yaml" type: "url" contract: v1beta1 replacements: - - old: --metrics-addr=127.0.0.1:8080 - new: --metrics-addr=:8080 + - old: --metrics-addr=127.0.0.1:8080 + new: --metrics-addr=:8080 files: - - sourcePath: "../data/shared/v1.4/metadata.yaml" - - name: v1.5.99 # next; use manifest from source files + - sourcePath: "../data/shared/v1.5/metadata.yaml" + - name: v1.6.99 # next; use manifest from source files value: ../../../config/default replacements: - old: --metrics-bind-addr=localhost:8080 @@ -82,25 +82,25 @@ providers: new: --metrics-addr=:8080 files: - sourcePath: "../data/shared/v1.0/metadata.yaml" - - name: v1.3.6 # supported release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.3.6/bootstrap-components.yaml" + - name: v1.4.5 # supported release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.5/bootstrap-components.yaml" type: "url" contract: v1beta1 replacements: - old: --metrics-addr=127.0.0.1:8080 new: --metrics-addr=:8080 files: - - sourcePath: "../data/shared/v1.3/metadata.yaml" - - name: v1.4.0 # latest published release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.0/bootstrap-components.yaml" + - sourcePath: "../data/shared/v1.4/metadata.yaml" + - name: v1.5.0 # latest published release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.0/bootstrap-components.yaml" type: "url" contract: v1beta1 replacements: - old: --metrics-addr=127.0.0.1:8080 new: --metrics-addr=:8080 files: - - sourcePath: "../data/shared/v1.4/metadata.yaml" - - name: v1.5.99 # next; use manifest from source files + - sourcePath: "../data/shared/v1.5/metadata.yaml" + - name: v1.6.99 # next; use manifest from source files value: ../../../bootstrap/kubeadm/config/default replacements: - old: --metrics-bind-addr=localhost:8080 @@ -120,25 +120,25 @@ providers: new: --metrics-addr=:8080 files: - sourcePath: "../data/shared/v1.0/metadata.yaml" - - name: v1.3.6 # supported release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.3.6/control-plane-components.yaml" + - name: v1.4.5 # supported release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.5/control-plane-components.yaml" type: "url" contract: v1beta1 replacements: - old: --metrics-addr=127.0.0.1:8080 new: --metrics-addr=:8080 files: - - sourcePath: "../data/shared/v1.3/metadata.yaml" - - name: v1.4.0 # latest published release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.0/control-plane-components.yaml" + - sourcePath: "../data/shared/v1.4/metadata.yaml" + - name: v1.5.0 # latest published release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.0/control-plane-components.yaml" type: "url" contract: v1beta1 replacements: - old: --metrics-addr=127.0.0.1:8080 new: --metrics-addr=:8080 files: - - sourcePath: "../data/shared/v1.4/metadata.yaml" - - name: v1.5.99 # next; use manifest from source files + - sourcePath: "../data/shared/v1.5/metadata.yaml" + - name: v1.6.99 # next; use manifest from source files value: ../../../controlplane/kubeadm/config/default replacements: - old: --metrics-bind-addr=localhost:8080 @@ -159,31 +159,31 @@ providers: files: - sourcePath: "../data/shared/v1.0/metadata.yaml" - sourcePath: "../data/infrastructure-docker/v1.0/cluster-template.yaml" - - name: v1.3.6 # supported release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.3.6/infrastructure-components-development.yaml" + - name: v1.4.5 # supported release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.5/infrastructure-components-development.yaml" type: "url" contract: v1beta1 replacements: - old: --metrics-addr=127.0.0.1:8080 new: --metrics-addr=:8080 files: - - sourcePath: "../data/shared/v1.3/metadata.yaml" - - sourcePath: "../data/infrastructure-docker/v1.3/cluster-template.yaml" - - sourcePath: "../data/infrastructure-docker/v1.3/cluster-template-topology.yaml" - - sourcePath: "../data/infrastructure-docker/v1.3/clusterclass-quick-start.yaml" - - name: v1.4.0 # latest published release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.0/infrastructure-components-development.yaml" + - sourcePath: "../data/shared/v1.4/metadata.yaml" + - sourcePath: "../data/infrastructure-docker/v1.4/cluster-template.yaml" + - sourcePath: "../data/infrastructure-docker/v1.4/cluster-template-topology.yaml" + - sourcePath: "../data/infrastructure-docker/v1.4/clusterclass-quick-start.yaml" + - name: v1.5.0 # latest published release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.0/infrastructure-components-development.yaml" type: "url" contract: v1beta1 replacements: - old: --metrics-addr=127.0.0.1:8080 new: --metrics-addr=:8080 files: - - sourcePath: "../data/shared/v1.4/metadata.yaml" - - sourcePath: "../data/infrastructure-docker/v1.4/cluster-template.yaml" - - sourcePath: "../data/infrastructure-docker/v1.4/cluster-template-topology.yaml" - - sourcePath: "../data/infrastructure-docker/v1.4/clusterclass-quick-start.yaml" - - name: v1.5.99 # next; use manifest from source files + - sourcePath: "../data/shared/v1.5/metadata.yaml" + - sourcePath: "../data/infrastructure-docker/v1.5/cluster-template.yaml" + - sourcePath: "../data/infrastructure-docker/v1.5/cluster-template-topology.yaml" + - sourcePath: "../data/infrastructure-docker/v1.5/clusterclass-quick-start.yaml" + - name: v1.6.99 # next; use manifest from source files value: ../../../test/infrastructure/docker/config/default replacements: - old: --metrics-bind-addr=localhost:8080 @@ -213,21 +213,21 @@ providers: - name: in-memory type: InfrastructureProvider versions: - - name: v1.5.99 # next; use manifest from source files + - name: v1.6.99 # next; use manifest from source files value: ../../../test/infrastructure/inmemory/config/default replacements: - old: --metrics-bind-addr=localhost:8080 new: "--metrics-bind-addr=:8080\n - --logging-format=json" files: - # Add cluster templates - - sourcePath: "../data/infrastructure-inmemory/main/clusterclass-in-memory.yaml" - - sourcePath: "../data/infrastructure-inmemory/main/cluster-template.yaml" - - sourcePath: "../data/shared/main/metadata.yaml" + # Add cluster templates + - sourcePath: "../data/infrastructure-inmemory/main/clusterclass-in-memory.yaml" + - sourcePath: "../data/infrastructure-inmemory/main/cluster-template.yaml" + - sourcePath: "../data/shared/main/metadata.yaml" - name: test-extension type: RuntimeExtensionProvider versions: - - name: v1.5.99 # next; use manifest from source files + - name: v1.6.99 # next; use manifest from source files value: ../../../test/extension/config/default files: - sourcePath: "../data/shared/main/metadata.yaml" diff --git a/test/e2e/data/infrastructure-docker/v1.3/bases/cluster-with-kcp.yaml b/test/e2e/data/infrastructure-docker/v1.5/bases/cluster-with-kcp.yaml similarity index 79% rename from test/e2e/data/infrastructure-docker/v1.3/bases/cluster-with-kcp.yaml rename to test/e2e/data/infrastructure-docker/v1.5/bases/cluster-with-kcp.yaml index d23e5343576b..30079167200d 100644 --- a/test/e2e/data/infrastructure-docker/v1.3/bases/cluster-with-kcp.yaml +++ b/test/e2e/data/infrastructure-docker/v1.5/bases/cluster-with-kcp.yaml @@ -56,8 +56,6 @@ metadata: spec: template: spec: - # NOTE: If the Kubernetes version is changed in `clusterctl_upgrade_test.go` the image and SHA must be updated here. - customImage: "kindest/node:v1.26.4@sha256:f4c0d87be03d6bea69f5e5dc0adb678bb498a190ee5c38422bf751541cebe92e" extraMounts: - containerPath: "/var/run/docker.sock" hostPath: "/var/run/docker.sock" @@ -87,15 +85,7 @@ spec: # host.docker.internal is required by kubetest when running on MacOS because of the way ports are proxied. certSANs: [localhost, 127.0.0.1, 0.0.0.0, host.docker.internal] initConfiguration: - nodeRegistration: - criSocket: unix:///var/run/containerd/containerd.sock - kubeletExtraArgs: - eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' - fail-swap-on: "false" + nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use. joinConfiguration: - nodeRegistration: - criSocket: unix:///var/run/containerd/containerd.sock - kubeletExtraArgs: - eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' - fail-swap-on: "false" + nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use. version: "${KUBERNETES_VERSION}" diff --git a/test/e2e/data/infrastructure-docker/v1.3/bases/cluster-with-topology.yaml b/test/e2e/data/infrastructure-docker/v1.5/bases/cluster-with-topology.yaml similarity index 65% rename from test/e2e/data/infrastructure-docker/v1.3/bases/cluster-with-topology.yaml rename to test/e2e/data/infrastructure-docker/v1.5/bases/cluster-with-topology.yaml index 5d03ea309283..529fc15f69d2 100644 --- a/test/e2e/data/infrastructure-docker/v1.3/bases/cluster-with-topology.yaml +++ b/test/e2e/data/infrastructure-docker/v1.5/bases/cluster-with-topology.yaml @@ -18,9 +18,11 @@ spec: controlPlane: metadata: labels: - label-from-cluster-topology: "value-from-cluster-topology" + Cluster.topology.controlPlane.label: "Cluster.topology.controlPlane.labelValue" + # Note: this label is propagated to Nodes. + Cluster.topology.controlPlane.label.node.cluster.x-k8s.io: "Cluster.topology.controlPlane.nodeLabelValue" annotations: - annotation-from-cluster-topology: "value-from-cluster-topology" + Cluster.topology.controlPlane.annotation: "Cluster.topology.controlPlane.annotationValue" nodeDeletionTimeout: "30s" nodeVolumeDetachTimeout: "5m" replicas: ${CONTROL_PLANE_MACHINE_COUNT} @@ -30,15 +32,18 @@ spec: name: "md-0" metadata: labels: - label-from-cluster-topology: "value-from-cluster-topology" + Cluster.topology.machineDeployment.label: "Cluster.topology.machineDeployment.labelValue" + # Note: this label is propagated to Nodes. + Cluster.topology.machineDeployment.label.node.cluster.x-k8s.io: "Cluster.topology.machineDeployment.nodeLabelValue" annotations: - annotation-from-cluster-topology: "value-from-cluster-topology" + Cluster.topology.machineDeployment.annotation: "Cluster.topology.machineDeployment.annotationValue" nodeDeletionTimeout: "30s" nodeVolumeDetachTimeout: "5m" minReadySeconds: 5 replicas: ${WORKER_MACHINE_COUNT} failureDomain: fd4 strategy: + type: RollingUpdate rollingUpdate: maxSurge: "20%" maxUnavailable: 0 diff --git a/test/e2e/data/infrastructure-docker/v1.3/bases/crs.yaml b/test/e2e/data/infrastructure-docker/v1.5/bases/crs.yaml similarity index 100% rename from test/e2e/data/infrastructure-docker/v1.3/bases/crs.yaml rename to test/e2e/data/infrastructure-docker/v1.5/bases/crs.yaml diff --git a/test/e2e/data/infrastructure-docker/v1.3/bases/md.yaml b/test/e2e/data/infrastructure-docker/v1.5/bases/md.yaml similarity index 75% rename from test/e2e/data/infrastructure-docker/v1.3/bases/md.yaml rename to test/e2e/data/infrastructure-docker/v1.5/bases/md.yaml index 8cd39f3ea274..5d42a2cf5e6a 100644 --- a/test/e2e/data/infrastructure-docker/v1.3/bases/md.yaml +++ b/test/e2e/data/infrastructure-docker/v1.5/bases/md.yaml @@ -8,8 +8,6 @@ metadata: spec: template: spec: - # NOTE: If the Kubernetes version is changed in `clusterctl_upgrade_test.go` the image and SHA must be updated here. - customImage: "kindest/node:v1.26.4@sha256:f4c0d87be03d6bea69f5e5dc0adb678bb498a190ee5c38422bf751541cebe92e" extraMounts: - containerPath: "/var/run/docker.sock" hostPath: "/var/run/docker.sock" @@ -25,11 +23,7 @@ spec: template: spec: joinConfiguration: - nodeRegistration: - criSocket: unix:///var/run/containerd/containerd.sock - kubeletExtraArgs: - eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' - fail-swap-on: "false" + nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use. --- # MachineDeployment object apiVersion: cluster.x-k8s.io/v1beta1 diff --git a/test/e2e/data/infrastructure-docker/v1.3/cluster-template-topology/kustomization.yaml b/test/e2e/data/infrastructure-docker/v1.5/cluster-template-topology/kustomization.yaml similarity index 100% rename from test/e2e/data/infrastructure-docker/v1.3/cluster-template-topology/kustomization.yaml rename to test/e2e/data/infrastructure-docker/v1.5/cluster-template-topology/kustomization.yaml diff --git a/test/e2e/data/infrastructure-docker/v1.3/cluster-template/kustomization.yaml b/test/e2e/data/infrastructure-docker/v1.5/cluster-template/kustomization.yaml similarity index 100% rename from test/e2e/data/infrastructure-docker/v1.3/cluster-template/kustomization.yaml rename to test/e2e/data/infrastructure-docker/v1.5/cluster-template/kustomization.yaml diff --git a/test/e2e/data/infrastructure-docker/v1.3/clusterclass-quick-start.yaml b/test/e2e/data/infrastructure-docker/v1.5/clusterclass-quick-start.yaml similarity index 58% rename from test/e2e/data/infrastructure-docker/v1.3/clusterclass-quick-start.yaml rename to test/e2e/data/infrastructure-docker/v1.5/clusterclass-quick-start.yaml index 84a9847fcb80..3d747dd49625 100644 --- a/test/e2e/data/infrastructure-docker/v1.3/clusterclass-quick-start.yaml +++ b/test/e2e/data/infrastructure-docker/v1.5/clusterclass-quick-start.yaml @@ -6,9 +6,9 @@ spec: controlPlane: metadata: labels: - label-from-clusterclass: "value-from-clusterclass" + ClusterClass.controlPlane.label: "ClusterClass.controlPlane.labelValue" annotations: - annotation-from-clusterclass: "value-from-clusterclass" + ClusterClass.controlPlane.annotation: "ClusterClass.controlPlane.annotationValue" ref: apiVersion: controlplane.cluster.x-k8s.io/v1beta1 kind: KubeadmControlPlaneTemplate @@ -35,9 +35,9 @@ spec: template: metadata: labels: - label-from-clusterclass: "value-from-clusterclass" + ClusterClass.machineDeployment.label: "ClusterClass.machineDeployment.labelValue" annotations: - annotation-from-clusterclass: "value-from-clusterclass" + ClusterClass.machineDeployment.annotation: "ClusterClass.machineDeployment.annotationValue" bootstrap: ref: apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 @@ -100,6 +100,18 @@ spec: openAPIV3Schema: type: boolean default: true + - name: externalCloudProvider + required: false + schema: + openAPIV3Schema: + type: boolean + default: false + - name: ipv6Primary + required: false + schema: + openAPIV3Schema: + type: boolean + default: false patches: - name: lbImageRepository definitions: @@ -114,44 +126,6 @@ spec: valueFrom: template: | imageRepository: {{ .lbImageRepository }} - # We have to pin the cgroupDriver to cgroupfs for Kubernetes < v1.24 because kind does not support systemd for those versions, but kubeadm >= 1.21 defaults to systemd. - - name: cgroupDriver-controlPlane - description: | - Sets the cgroupDriver to cgroupfs if a Kubernetes version < v1.24 is referenced. - This is required because kind and the node images do not support the default - systemd cgroupDriver for kubernetes < v1.24. - enabledIf: '{{ semverCompare "<= v1.23" .builtin.controlPlane.version }}' - definitions: - - selector: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlaneTemplate - matchResources: - controlPlane: true - jsonPatches: - - op: add - path: "/spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/kubeletExtraArgs/cgroup-driver" - value: cgroupfs - - op: add - path: "/spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/kubeletExtraArgs/cgroup-driver" - value: cgroupfs - - name: cgroupDriver-machineDeployment - description: | - Sets the cgroupDriver to cgroupfs if a Kubernetes version < v1.24 is referenced. - This is required because kind and the node images do not support the default - systemd cgroupDriver for kubernetes < v1.24. - enabledIf: '{{ semverCompare "<= v1.23" .builtin.machineDeployment.version }}' - definitions: - - selector: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - matchResources: - machineDeploymentClass: - names: - - default-worker - jsonPatches: - - op: add - path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/cgroup-driver" - value: cgroupfs - name: etcdImageTag description: "Sets tag to use for the etcd image in the KubeadmControlPlane." definitions: @@ -181,6 +155,33 @@ spec: valueFrom: template: | imageTag: {{ .coreDNSImageTag }} + - name: customImage + description: "Sets the container image that is used for running dockerMachines for the controlPlane and default-worker machineDeployments." + definitions: + - selector: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: DockerMachineTemplate + matchResources: + machineDeploymentClass: + names: + - default-worker + jsonPatches: + - op: add + path: "/spec/template/spec/customImage" + valueFrom: + template: | + kindest/node:{{ .builtin.machineDeployment.version | replace "+" "_" }} + - selector: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: DockerMachineTemplate + matchResources: + controlPlane: true + jsonPatches: + - op: add + path: "/spec/template/spec/customImage" + valueFrom: + template: | + kindest/node:{{ .builtin.controlPlane.version | replace "+" "_" }} - name: preloadImages description: | Sets the container images to preload to the node that is used for running dockerMachines. @@ -229,6 +230,54 @@ spec: - op: add path: "/spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/taints" value: [] + - name: controlPlaneExternalCloudProvider + enabledIf: "{{ .externalCloudProvider }}" + description: "Configures kubelet to run with an external cloud provider for control plane nodes." + definitions: + - selector: + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 + kind: KubeadmControlPlaneTemplate + matchResources: + controlPlane: true + jsonPatches: + - op: add + path: "/spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/kubeletExtraArgs" + value: + cloud-provider: "external" + - op: add + path: "/spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/kubeletExtraArgs" + value: + cloud-provider: "external" + - name: machineDeploymentExternalCloudProvider + enabledIf: "{{ .externalCloudProvider }}" + description: "Configures kubelet to run with an external cloud provider for machineDeployment nodes." + definitions: + - selector: + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 + kind: KubeadmConfigTemplate + matchResources: + machineDeploymentClass: + names: + - '*-worker' + jsonPatches: + - op: add + path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs" + value: + cloud-provider: "external" + - name: localEndpointIPv6 + enabledIf: "{{ .ipv6Primary }}" + description: "Configures KCP to use IPv6 for its localAPIEndpoint." + definitions: + - selector: + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 + kind: KubeadmControlPlaneTemplate + matchResources: + controlPlane: true + jsonPatches: + - op: add + path: "/spec/template/spec/kubeadmConfigSpec/initConfiguration/localAPIEndpoint" + value: + advertiseAddress: '::' - name: podSecurityStandard description: "Adds an admission configuration for PodSecurity to the kube-apiserver." definitions: @@ -280,8 +329,17 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: DockerClusterTemplate metadata: name: quick-start-cluster + labels: + InfrastructureClusterTemplate.label: "InfrastructureClusterTemplate.labelValue" + annotations: + InfrastructureClusterTemplate.annotation: "InfrastructureClusterTemplate.annotationValue" spec: template: + metadata: + labels: + InfrastructureClusterTemplate.template.label: "InfrastructureClusterTemplate.template.labelValue" + annotations: + InfrastructureClusterTemplate.template.annotation: "InfrastructureClusterTemplate.template.annotationValue" spec: failureDomains: fd1: @@ -305,12 +363,26 @@ kind: KubeadmControlPlaneTemplate apiVersion: controlplane.cluster.x-k8s.io/v1beta1 metadata: name: quick-start-control-plane + labels: + ControlPlaneTemplate.label: "ControlPlaneTemplate.labelValue" + annotations: + ControlPlaneTemplate.annotation: "ControlPlaneTemplate.annotationValue" spec: template: + metadata: + labels: + ControlPlaneTemplate.template.label: "ControlPlaneTemplate.template.labelValue" + annotations: + ControlPlaneTemplate.template.annotation: "ControlPlaneTemplate.template.annotationValue" spec: rolloutBefore: certificatesExpiryDays: 21 machineTemplate: + metadata: + labels: + ControlPlaneTemplate.machineTemplate.label: "ControlPlaneTemplate.machineTemplate.labelValue" + annotations: + ControlPlaneTemplate.machineTemplate.annotation: "ControlPlaneTemplate.machineTemplate.annotationValue" nodeDrainTimeout: 1s kubeadmConfigSpec: clusterConfiguration: @@ -318,31 +390,32 @@ spec: extraArgs: { enable-hostpath-provisioner: 'true' } apiServer: # host.docker.internal is required by kubetest when running on MacOS because of the way ports are proxied. - certSANs: [localhost, 127.0.0.1, 0.0.0.0, host.docker.internal] + certSANs: [localhost, host.docker.internal, "::", "::1", "127.0.0.1", "0.0.0.0"] initConfiguration: - nodeRegistration: - # We have to set the criSocket to containerd as kubeadm defaults to docker runtime if both containerd and docker sockets are found - criSocket: unix:///var/run/containerd/containerd.sock - kubeletExtraArgs: + nodeRegistration: # node registration parameters are automatically injected by CAPD according to the kindest/node image in use. + kubeletExtraArgs: # having a not empty kubeletExtraArgs is required for the externalCloudProvider patch to work eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' - fail-swap-on: "false" joinConfiguration: - nodeRegistration: - # We have to set the criSocket to containerd as kubeadm defaults to docker runtime if both containerd and docker sockets are found - criSocket: unix:///var/run/containerd/containerd.sock - kubeletExtraArgs: + nodeRegistration: # node registration parameters are automatically injected by CAPD according to the kindest/node image in use. + kubeletExtraArgs: # having a not empty kubeletExtraArgs is required for the externalCloudProvider patch to work eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' - fail-swap-on: "false" --- apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: DockerMachineTemplate metadata: name: quick-start-control-plane + labels: + InfraMachineTemplate.controlPlane.label: "InfraMachineTemplate.controlPlane.labelValue" + annotations: + InfraMachineTemplate.controlPlane.annotation: "InfraMachineTemplate.controlPlane.annotationValue" spec: template: + metadata: + labels: + InfraMachineTemplate.controlPlane.template.label: "InfraMachineTemplate.controlPlane.template.labelValue" + annotations: + InfraMachineTemplate.controlPlane.template.annotation: "InfraMachineTemplate.controlPlane.template.annotationValue" spec: - # NOTE: If the Kubernetes version is changed in `clusterctl_upgrade_test.go` the image and SHA must be updated here. - customImage: "kindest/node:v1.26.4@sha256:f4c0d87be03d6bea69f5e5dc0adb678bb498a190ee5c38422bf751541cebe92e" extraMounts: - containerPath: "/var/run/docker.sock" hostPath: "/var/run/docker.sock" @@ -351,11 +424,18 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: DockerMachineTemplate metadata: name: quick-start-default-worker-machinetemplate + labels: + InfraMachineTemplate.machineDeployment.label: "InfraMachineTemplate.machineDeployment.labelValue" + annotations: + InfraMachineTemplate.machineDeployment.annotation: "InfraMachineTemplate.machineDeployment.annotationValue" spec: template: + metadata: + labels: + InfraMachineTemplate.machineDeployment.template.label: "InfraMachineTemplate.machineDeployment.template.labelValue" + annotations: + InfraMachineTemplate.machineDeployment.template.annotation: "InfraMachineTemplate.machineDeployment.template.annotationValue" spec: - # NOTE: If the Kubernetes version is changed in `clusterctl_upgrade_test.go` the image and SHA must be updated here. - customImage: "kindest/node:v1.26.4@sha256:f4c0d87be03d6bea69f5e5dc0adb678bb498a190ee5c38422bf751541cebe92e" extraMounts: - containerPath: "/var/run/docker.sock" hostPath: "/var/run/docker.sock" @@ -364,14 +444,19 @@ apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: KubeadmConfigTemplate metadata: name: quick-start-default-worker-bootstraptemplate + labels: + BootstrapConfigTemplate.machineDeployment.label: "BootstrapConfigTemplate.machineDeployment.labelValue" + annotations: + BootstrapConfigTemplate.machineDeployment.annotation: "BootstrapConfigTemplate.machineDeployment.annotationValue" spec: template: + metadata: + labels: + BootstrapConfigTemplate.machineDeployment.template.label: "BootstrapConfigTemplate.machineDeployment.template.labelValue" + annotations: + BootstrapConfigTemplate.machineDeployment.template.annotation: "BootstrapConfigTemplate.machineDeployment.template.annotationValue" spec: joinConfiguration: - nodeRegistration: - # We have to set the criSocket to containerd as kubeadm defaults to docker runtime if both containerd and docker sockets are found - criSocket: unix:///var/run/containerd/containerd.sock - kubeletExtraArgs: + nodeRegistration: # node registration parameters are automatically injected by CAPD according to the kindest/node image in use. + kubeletExtraArgs: # having a not empty kubeletExtraArgs is required for the externalCloudProvider to work eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' - fail-swap-on: "false" - diff --git a/test/e2e/data/shared/main/metadata.yaml b/test/e2e/data/shared/main/metadata.yaml index 87cd651cb618..0fedda628239 100644 --- a/test/e2e/data/shared/main/metadata.yaml +++ b/test/e2e/data/shared/main/metadata.yaml @@ -1,6 +1,9 @@ apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3 kind: Metadata releaseSeries: + - major: 1 + minor: 6 + contract: v1beta1 - major: 1 minor: 5 contract: v1beta1 diff --git a/test/e2e/data/shared/v1.3/metadata.yaml b/test/e2e/data/shared/v1.5/metadata.yaml similarity index 81% rename from test/e2e/data/shared/v1.3/metadata.yaml rename to test/e2e/data/shared/v1.5/metadata.yaml index ff9cdc10131b..87cd651cb618 100644 --- a/test/e2e/data/shared/v1.3/metadata.yaml +++ b/test/e2e/data/shared/v1.5/metadata.yaml @@ -1,6 +1,12 @@ apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3 kind: Metadata releaseSeries: + - major: 1 + minor: 5 + contract: v1beta1 + - major: 1 + minor: 4 + contract: v1beta1 - major: 1 minor: 3 contract: v1beta1