Skip to content

Commit

Permalink
Prepare main branch for v1.9 development
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Büringer buringerst@vmware.com
  • Loading branch information
sbueringer committed Aug 15, 2024
1 parent b8d0914 commit 8d51c58
Show file tree
Hide file tree
Showing 17 changed files with 1,100 additions and 48 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ generate-doctoc:
TRACE=$(TRACE) ./hack/generate-doctoc.sh

.PHONY: generate-e2e-templates
generate-e2e-templates: $(KUSTOMIZE) $(addprefix generate-e2e-templates-, v0.3 v0.4 v1.0 v1.5 v1.6 v1.7 main) ## Generate cluster templates for all versions
generate-e2e-templates: $(KUSTOMIZE) $(addprefix generate-e2e-templates-, v0.3 v0.4 v1.0 v1.5 v1.6 v1.7 v1.8 main) ## Generate cluster templates for all versions

DOCKER_TEMPLATES := test/e2e/data/infrastructure-docker
INMEMORY_TEMPLATES := test/e2e/data/infrastructure-inmemory
Expand Down Expand Up @@ -590,6 +590,11 @@ generate-e2e-templates-v1.7: $(KUSTOMIZE)
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.7/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.7/cluster-template.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.7/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.7/cluster-template-topology.yaml

.PHONY: generate-e2e-templates-v1.8
generate-e2e-templates-v1.8: $(KUSTOMIZE)
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.8/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.8/cluster-template.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.8/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.8/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
Expand Down
12 changes: 6 additions & 6 deletions cmd/clusterctl/hack/create-local-repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,36 +54,36 @@
providers = {
'cluster-api': {
'componentsFile': 'core-components.yaml',
'nextVersion': 'v1.8.99',
'nextVersion': 'v1.9.99',
'type': 'CoreProvider',
},
'bootstrap-kubeadm': {
'componentsFile': 'bootstrap-components.yaml',
'nextVersion': 'v1.8.99',
'nextVersion': 'v1.9.99',
'type': 'BootstrapProvider',
'configFolder': 'bootstrap/kubeadm/config/default',
},
'control-plane-kubeadm': {
'componentsFile': 'control-plane-components.yaml',
'nextVersion': 'v1.8.99',
'nextVersion': 'v1.9.99',
'type': 'ControlPlaneProvider',
'configFolder': 'controlplane/kubeadm/config/default',
},
'infrastructure-docker': {
'componentsFile': 'infrastructure-components-development.yaml',
'nextVersion': 'v1.8.99',
'nextVersion': 'v1.9.99',
'type': 'InfrastructureProvider',
'configFolder': 'test/infrastructure/docker/config/default',
},
'infrastructure-in-memory': {
'componentsFile': 'infrastructure-components-in-memory-development.yaml',
'nextVersion': 'v1.8.99',
'nextVersion': 'v1.9.99',
'type': 'InfrastructureProvider',
'configFolder': 'test/infrastructure/inmemory/config/default',
},
'runtime-extension-test': {
'componentsFile': 'runtime-extension-components-development.yaml',
'nextVersion': 'v1.8.99',
'nextVersion': 'v1.9.99',
'type': 'RuntimeExtensionProvider',
'configFolder': 'test/extension/config/default',
},
Expand Down
14 changes: 6 additions & 8 deletions docs/release/release-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ is used for e.g. local development and e2e tests. We also modify tests so that t
This comes down to changing occurrences of the old version to the new version, e.g. `v1.5` to `v1.6`:

1. Setup E2E tests for the new release:
1. Goal is that we have clusterctl upgrade tests for the latest stable versions of each contract / for each supported branch. For `v1.6` this means:
* v1beta1: `v1.0`, `v1.4`, `v1.5` (will change with each new release)
1. Goal is that we have clusterctl upgrade tests for all relevant upgrade cases
1. Modify the test specs in `test/e2e/clusterctl_upgrade_test.go`. Please note the comments above each test case (look for `This test should be changed during "prepare main branch"`)
Please note that both `InitWithKubernetesVersion` and `WorkloadKubernetesVersion` should be the highest management cluster version supported by the respective Cluster API version.
2. Please ping maintainers after these changes are made for a first round of feedback before continuing with the steps below.
2. Update providers in `docker.yaml`:
1. Add a new `v1.6.0` entry.
2. Remove providers that are not used anymore in clusterctl upgrade tests.
Expand All @@ -112,17 +114,13 @@ This comes down to changing occurrences of the old version to the new version, e
4. Adjust cluster templates in `test/e2e/data/infrastructure-docker`:
1. Create a new `v1.6` 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`).
2. Remove old folders that are not used anymore in clusterctl upgrade tests.
5. Modify the test specs in `test/e2e/clusterctl_upgrade_test.go` (according to the versions we want to test described above).
Please note that both `InitWithKubernetesVersion` and `WorkloadKubernetesVersion` should be the highest mgmt cluster version supported by the respective Cluster API version.
5. Add a new Makefile target (e.g. `generate-e2e-templates-v1.6`) and potentially remove the Makefile target of versions that are not used anymore (if something was removed in 4.2)
2. Update `create-local-repository.py` and `tools/internal/tilt-prepare/main.go`: `v1.5.99` => `v1.6.99`.
3. Make sure all tests are green (also run `pull-cluster-api-e2e-full-main` and `pull-cluster-api-e2e-workload-upgrade-1-27-latest-main`).
4. Remove an unsupported release version of Cluster API from the Makefile target that generates e2e templates. For example, remove `v1.3` while working on `v1.6`.

Prior art:

* 1.5 - https://github.com/kubernetes-sigs/cluster-api/pull/8430/files
* 1.6 - https://github.com/kubernetes-sigs/cluster-api/pull/9097/files
* 1.7 - https://github.com/kubernetes-sigs/cluster-api/pull/9799/files
* 1.9 - https://github.com/kubernetes-sigs/cluster-api/pull/11059

#### Create a new GitHub milestone for the next release

Expand Down
2 changes: 1 addition & 1 deletion hack/tools/internal/tilt-prepare/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,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.8.99"
defaultProviderVersion = "v1.9.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.
Expand Down
3 changes: 3 additions & 0 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3
kind: Metadata
releaseSeries:
- major: 1
minor: 9
contract: v1beta1
- major: 1
minor: 8
contract: v1beta1
Expand Down
56 changes: 32 additions & 24 deletions test/e2e/clusterctl_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var (
providerDockerPrefix = "docker:v%s"
)

// Note: This test should not be changed during "prepare main branch".
var _ = Describe("When testing clusterctl upgrades (v0.3=>v1.5=>current)", func() {
// We are testing v0.3=>v1.5=>current to ensure that old entries with v1alpha3 in managed files do not cause issues
// as described in https://github.com/kubernetes-sigs/cluster-api/issues/10051.
Expand Down Expand Up @@ -114,6 +115,7 @@ var _ = Describe("When testing clusterctl upgrades (v0.3=>v1.5=>current)", func(
})
})

// Note: This test should not be changed during "prepare main branch".
var _ = Describe("When testing clusterctl upgrades (v0.4=>v1.6=>current)", func() {
// We are testing v0.4=>v1.6=>current to ensure that old entries with v1alpha4 in managed files do not cause issues
// as described in https://github.com/kubernetes-sigs/cluster-api/issues/10051.
Expand Down Expand Up @@ -180,6 +182,7 @@ var _ = Describe("When testing clusterctl upgrades (v0.4=>v1.6=>current)", func(
})
})

// Note: This test should not be changed during "prepare main branch".
var _ = Describe("When testing clusterctl upgrades (v1.0=>current)", func() {
// Get v1.0 latest stable release
version := "1.0"
Expand Down Expand Up @@ -215,9 +218,10 @@ var _ = Describe("When testing clusterctl upgrades (v1.0=>current)", func() {
})
})

var _ = Describe("When testing clusterctl upgrades (v1.6=>current)", func() {
// Get v1.6 latest stable release
version := "1.6"
// Note: This test should be changed during "prepare main branch", it should test n-2 => current.
var _ = Describe("When testing clusterctl upgrades (v1.7=>current)", func() {
// Get v1.7 latest stable release
version := "1.7"
stableRelease, err := GetStableReleaseOfMinor(ctx, version)
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for minor release : %s", version)
ClusterctlUpgradeSpec(ctx, func() ClusterctlUpgradeSpecInput {
Expand All @@ -237,18 +241,19 @@ var _ = Describe("When testing clusterctl upgrades (v1.6=>current)", func() {
InitWithInfrastructureProviders: []string{fmt.Sprintf(providerDockerPrefix, stableRelease)},
InitWithProvidersContract: "v1beta1",
// Note: Both InitWithKubernetesVersion and WorkloadKubernetesVersion should be the highest mgmt cluster version supported by the source Cluster API version.
InitWithKubernetesVersion: "v1.29.0",
WorkloadKubernetesVersion: "v1.29.0",
InitWithKubernetesVersion: "v1.30.0",
WorkloadKubernetesVersion: "v1.30.0",
MgmtFlavor: "topology",
WorkloadFlavor: "",
UseKindForManagementCluster: true,
}
})
})

var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.6=>current) [ClusterClass]", func() {
// Get v1.6 latest stable release
version := "1.6"
// Note: This test should be changed during "prepare main branch", it should test n-2 => current.
var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.7=>current) [ClusterClass]", func() {
// Get v1.7 latest stable release
version := "1.7"
stableRelease, err := GetStableReleaseOfMinor(ctx, version)
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for minor release : %s", version)
ClusterctlUpgradeSpec(ctx, func() ClusterctlUpgradeSpecInput {
Expand All @@ -268,18 +273,19 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.6=>cur
InitWithInfrastructureProviders: []string{fmt.Sprintf(providerDockerPrefix, stableRelease)},
InitWithProvidersContract: "v1beta1",
// Note: Both InitWithKubernetesVersion and WorkloadKubernetesVersion should be the highest mgmt cluster version supported by the source Cluster API version.
InitWithKubernetesVersion: "v1.29.0",
WorkloadKubernetesVersion: "v1.29.0",
InitWithKubernetesVersion: "v1.30.0",
WorkloadKubernetesVersion: "v1.30.0",
MgmtFlavor: "topology",
WorkloadFlavor: "topology",
UseKindForManagementCluster: true,
}
})
})

var _ = Describe("When testing clusterctl upgrades (v1.7=>current)", func() {
// Get v1.7 latest stable release
version := "1.7"
// Note: This test should be changed during "prepare main branch", it should test n-1 => current.
var _ = Describe("When testing clusterctl upgrades (v1.8=>current)", func() {
// Get v1.8 latest stable release
version := "1.8"
stableRelease, err := GetStableReleaseOfMinor(ctx, version)
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for minor release : %s", version)
ClusterctlUpgradeSpec(ctx, func() ClusterctlUpgradeSpecInput {
Expand All @@ -293,18 +299,19 @@ var _ = Describe("When testing clusterctl upgrades (v1.7=>current)", func() {
InitWithBinary: fmt.Sprintf(clusterctlDownloadURL, stableRelease),
InitWithProvidersContract: "v1beta1",
// Note: Both InitWithKubernetesVersion and WorkloadKubernetesVersion should be the highest mgmt cluster version supported by the source Cluster API version.
InitWithKubernetesVersion: "v1.30.0",
WorkloadKubernetesVersion: "v1.30.0",
InitWithKubernetesVersion: "v1.31.0",
WorkloadKubernetesVersion: "v1.31.0",
MgmtFlavor: "topology",
WorkloadFlavor: "",
UseKindForManagementCluster: true,
}
})
})

var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.7=>current) [ClusterClass]", func() {
// Get v1.7 latest stable release
version := "1.7"
// Note: This test should be changed during "prepare main branch", it should test n-1 => current.
var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.8=>current) [ClusterClass]", func() {
// Get v1.8 latest stable release
version := "1.8"
stableRelease, err := GetStableReleaseOfMinor(ctx, version)
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for minor release : %s", version)
ClusterctlUpgradeSpec(ctx, func() ClusterctlUpgradeSpecInput {
Expand All @@ -318,18 +325,19 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.7=>cur
InitWithBinary: fmt.Sprintf(clusterctlDownloadURL, stableRelease),
InitWithProvidersContract: "v1beta1",
// Note: Both InitWithKubernetesVersion and WorkloadKubernetesVersion should be the highest mgmt cluster version supported by the source Cluster API version.
InitWithKubernetesVersion: "v1.30.0",
WorkloadKubernetesVersion: "v1.30.0",
InitWithKubernetesVersion: "v1.31.0",
WorkloadKubernetesVersion: "v1.31.0",
MgmtFlavor: "topology",
WorkloadFlavor: "topology",
UseKindForManagementCluster: true,
}
})
})

var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.7=>current) on K8S latest ci mgmt cluster [ClusterClass]", func() {
// Get v1.7 latest stable release
version := "1.7"
// Note: This test should be changed during "prepare main branch", it should test n-1 => current.
var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.8=>current) on K8S latest ci mgmt cluster [ClusterClass]", func() {
// Get v1.8 latest stable release
version := "1.8"
stableRelease, err := GetStableReleaseOfMinor(ctx, version)
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for minor release : %s", version)
ClusterctlUpgradeSpec(ctx, func() ClusterctlUpgradeSpecInput {
Expand All @@ -347,7 +355,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.7=>cur
// Note: InitWithKubernetesVersion should be the latest of the next supported kubernetes version by the target Cluster API version.
// Note: WorkloadKubernetesVersion should be the highest mgmt cluster version supported by the source Cluster API version.
InitWithKubernetesVersion: initKubernetesVersion,
WorkloadKubernetesVersion: "v1.30.0",
WorkloadKubernetesVersion: "v1.31.0",
MgmtFlavor: "topology",
WorkloadFlavor: "topology",
UseKindForManagementCluster: true,
Expand Down
55 changes: 47 additions & 8 deletions test/e2e/config/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,20 @@ providers:
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.7/metadata.yaml"
- name: v1.8.99 # next; use manifest from source files
- name: "{go://sigs.k8s.io/cluster-api@v1.8}" # 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/{go://sigs.k8s.io/cluster-api@v1.8}/core-components.yaml"
type: "url"
contract: v1beta1
replacements:
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8080
files:
- sourcePath: "../data/shared/v1.8/metadata.yaml"
- name: v1.9.99 # next; use manifest from source files
value: ../../../config/default
replacements:
- old: "--leader-elect"
Expand Down Expand Up @@ -154,7 +163,16 @@ providers:
new: --metrics-addr=:8080
files:
- sourcePath: "../data/shared/v1.7/metadata.yaml"
- name: v1.8.99 # next; use manifest from source files
- name: "{go://sigs.k8s.io/cluster-api@v1.8}" # 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/{go://sigs.k8s.io/cluster-api@v1.8}/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.8/metadata.yaml"
- name: v1.9.99 # next; use manifest from source files
value: ../../../bootstrap/kubeadm/config/default
replacements:
- old: "--leader-elect"
Expand Down Expand Up @@ -219,7 +237,16 @@ providers:
new: --metrics-addr=:8080
files:
- sourcePath: "../data/shared/v1.7/metadata.yaml"
- name: v1.8.99 # next; use manifest from source files
- name: "{go://sigs.k8s.io/cluster-api@v1.8}" # 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/{go://sigs.k8s.io/cluster-api@v1.8}/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.8/metadata.yaml"
- name: v1.9.99 # next; use manifest from source files
value: ../../../controlplane/kubeadm/config/default
replacements:
- old: "--leader-elect"
Expand Down Expand Up @@ -296,7 +323,19 @@ providers:
- sourcePath: "../data/infrastructure-docker/v1.7/cluster-template.yaml"
- sourcePath: "../data/infrastructure-docker/v1.7/cluster-template-topology.yaml"
- sourcePath: "../data/infrastructure-docker/v1.7/clusterclass-quick-start.yaml"
- name: v1.8.99 # next; use manifest from source files
- name: "{go://sigs.k8s.io/cluster-api@v1.8}" # 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/{go://sigs.k8s.io/cluster-api@v1.8}/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.8/metadata.yaml"
- sourcePath: "../data/infrastructure-docker/v1.8/cluster-template.yaml"
- sourcePath: "../data/infrastructure-docker/v1.8/cluster-template-topology.yaml"
- sourcePath: "../data/infrastructure-docker/v1.8/clusterclass-quick-start.yaml"
- name: v1.9.99 # next; use manifest from source files
value: ../../../test/infrastructure/docker/config/default
replacements:
- old: "--leader-elect"
Expand Down Expand Up @@ -326,7 +365,7 @@ providers:
- name: in-memory
type: InfrastructureProvider
versions:
- name: v1.8.99 # next; use manifest from source files
- name: v1.9.99 # next; use manifest from source files
value: ../../../test/infrastructure/inmemory/config/default
replacements:
- old: "--leader-elect"
Expand All @@ -340,7 +379,7 @@ providers:
- name: test-extension
type: RuntimeExtensionProvider
versions:
- name: v1.8.99 # next; use manifest from source files
- name: v1.9.99 # next; use manifest from source files
value: ../../../test/extension/config/default
replacements:
- old: "--leader-elect"
Expand Down
Loading

0 comments on commit 8d51c58

Please sign in to comment.