Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Fill up supervisor e2e test - clusterctl upgrades using ClusterClass #3024

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,17 @@ generate-e2e-templates-v1.10: $(KUSTOMIZE)
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.10/clusterclass" > "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.10/clusterclass-quick-start.yaml"
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.10/workload" > "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.10/cluster-template-workload.yaml"

"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_SUPERVISOR_TEMPLATE_DIR)/v1.10/clusterclass" > "$(E2E_SUPERVISOR_TEMPLATE_DIR)/v1.10/clusterclass-quick-start-supervisor.yaml"
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_SUPERVISOR_TEMPLATE_DIR)/v1.10/workload" > "$(E2E_SUPERVISOR_TEMPLATE_DIR)/v1.10/cluster-template-workload-supervisor.yaml"
chrischdi marked this conversation as resolved.
Show resolved Hide resolved

.PHONY: generate-e2e-templates-v1.9
generate-e2e-templates-v1.9: $(KUSTOMIZE)
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.9/clusterclass" > "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.9/clusterclass-quick-start.yaml"
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.9/workload" > "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.9/cluster-template-workload.yaml"

"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_SUPERVISOR_TEMPLATE_DIR)/v1.9/clusterclass" > "$(E2E_SUPERVISOR_TEMPLATE_DIR)/v1.9/clusterclass-quick-start-supervisor.yaml"
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_SUPERVISOR_TEMPLATE_DIR)/v1.9/workload" > "$(E2E_SUPERVISOR_TEMPLATE_DIR)/v1.9/cluster-template-workload-supervisor.yaml"
chrischdi marked this conversation as resolved.
Show resolved Hide resolved

.PHONY: generate-test-infra-prowjobs
generate-test-infra-prowjobs: $(PROWJOB_GEN) ## Generates the prowjob configurations in test-infra
@if [ -z "${TEST_INFRA_DIR}" ]; then echo "TEST_INFRA_DIR is not set"; exit 1; fi
Expand Down
35 changes: 19 additions & 16 deletions test/e2e/clusterctl_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
capi_e2e "sigs.k8s.io/cluster-api/test/e2e"
"sigs.k8s.io/cluster-api/test/framework"
"sigs.k8s.io/cluster-api/test/framework/clusterctl"

vsphereframework "sigs.k8s.io/cluster-api-provider-vsphere/test/framework"
)

var (
Expand All @@ -37,7 +36,7 @@ var (
capvReleaseMarkerPrefix = "go://sigs.k8s.io/cluster-api-provider-vsphere@v%s"
)

var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10=>current, CAPI 1.7=>1.7) [ClusterClass]", func() {
var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10=>current, CAPI 1.7=>1.7) [supervisor] [ClusterClass]", func() {
const specName = "clusterctl-upgrade-1.10-current" // prefix (clusterctl-upgrade) copied from CAPI
Setup(specName, func(testSpecificSettingsGetter func() testSettings) {
capi_e2e.ClusterctlUpgradeSpec(ctx, func() capi_e2e.ClusterctlUpgradeSpecInput {
Expand All @@ -55,27 +54,27 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10
SkipCleanup: skipCleanup,
MgmtFlavor: testSpecificSettingsGetter().FlavorForMode("topology"),
PostNamespaceCreated: testSpecificSettingsGetter().PostNamespaceCreatedFunc,
PreUpgrade: vsphereframework.LoadImagesFunc(ctx),
sbueringer marked this conversation as resolved.
Show resolved Hide resolved
InitWithBinary: fmt.Sprintf(clusterctlDownloadURL, capiStableRelease),
InitWithCoreProvider: fmt.Sprintf(providerCAPIPrefix, capiStableRelease),
InitWithBootstrapProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)},
InitWithControlPlaneProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)},
InitWithInfrastructureProviders: []string{fmt.Sprintf(providerVSpherePrefix, capvStableRelease)},
InitWithRuntimeExtensionProviders: []string{},
InitWithRuntimeExtensionProviders: testSpecificSettingsGetter().RuntimeExtensionProviders,
chrischdi marked this conversation as resolved.
Show resolved Hide resolved
InitWithIPAMProviders: []string{},
// InitWithKubernetesVersion should be the highest kubernetes version supported by the init Cluster API version.
// This is to guarantee that both, the old and new CAPI version, support the defined version.
// Ensure all Kubernetes versions used here are covered in patch-vsphere-template.yaml
InitWithKubernetesVersion: "v1.30.0",
WorkloadKubernetesVersion: "v1.30.0",
WorkloadFlavor: testSpecificSettingsGetter().FlavorForMode("workload"),
UseKindForManagementCluster: true,
InitWithKubernetesVersion: "v1.30.0",
WorkloadKubernetesVersion: "v1.30.0",
WorkloadFlavor: testSpecificSettingsGetter().FlavorForMode("workload"),
UseKindForManagementCluster: true,
KindManagementClusterNewClusterProxyFunc: kindManagementClusterNewClusterProxyFunc,
}
})
}, WithIP("WORKLOAD_CONTROL_PLANE_ENDPOINT_IP"))
})

var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.9=>current, CAPI 1.6=>1.7) [ClusterClass]", func() {
var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.9=>current, CAPI 1.6=>1.7) [supervisor] [ClusterClass]", func() {
const specName = "clusterctl-upgrade-1.9-current" // prefix (clusterctl-upgrade) copied from CAPI
Setup(specName, func(testSpecificSettingsGetter func() testSettings) {
capi_e2e.ClusterctlUpgradeSpec(ctx, func() capi_e2e.ClusterctlUpgradeSpecInput {
chrischdi marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -93,21 +92,21 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.9=
SkipCleanup: skipCleanup,
MgmtFlavor: testSpecificSettingsGetter().FlavorForMode("topology"),
PostNamespaceCreated: testSpecificSettingsGetter().PostNamespaceCreatedFunc,
PreUpgrade: vsphereframework.LoadImagesFunc(ctx),
InitWithBinary: fmt.Sprintf(clusterctlDownloadURL, capiStableRelease),
InitWithCoreProvider: fmt.Sprintf(providerCAPIPrefix, capiStableRelease),
InitWithBootstrapProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)},
InitWithControlPlaneProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)},
InitWithInfrastructureProviders: []string{fmt.Sprintf(providerVSpherePrefix, capvStableRelease)},
InitWithRuntimeExtensionProviders: []string{},
InitWithRuntimeExtensionProviders: testSpecificSettingsGetter().RuntimeExtensionProviders,
InitWithIPAMProviders: []string{},
// InitWithKubernetesVersion should be the highest kubernetes version supported by the init Cluster API version.
// This is to guarantee that both, the old and new CAPI version, support the defined version.
// Ensure all Kubernetes versions used here are covered in patch-vsphere-template.yaml
InitWithKubernetesVersion: "v1.29.0",
WorkloadKubernetesVersion: "v1.29.0",
WorkloadFlavor: testSpecificSettingsGetter().FlavorForMode("workload"),
UseKindForManagementCluster: true,
InitWithKubernetesVersion: "v1.29.0",
WorkloadKubernetesVersion: "v1.29.0",
WorkloadFlavor: testSpecificSettingsGetter().FlavorForMode("workload"),
UseKindForManagementCluster: true,
KindManagementClusterNewClusterProxyFunc: kindManagementClusterNewClusterProxyFunc,
}
})
}, WithIP("WORKLOAD_CONTROL_PLANE_ENDPOINT_IP"))
Expand All @@ -118,3 +117,7 @@ func getStableReleaseOfMinor(ctx context.Context, releaseMarkerPrefix, minorRele
releaseMarker := fmt.Sprintf(releaseMarkerPrefix, minorRelease)
return clusterctl.ResolveRelease(ctx, releaseMarker)
}

func kindManagementClusterNewClusterProxyFunc(name string, kubeconfigPath string) framework.ClusterProxy {
return framework.NewClusterProxy(name, kubeconfigPath, initScheme())
}
7 changes: 7 additions & 0 deletions test/e2e/config/vsphere.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ providers:
# Add a cluster template
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-govmomi/v1.10/cluster-template-workload.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-govmomi/v1.10/clusterclass-quick-start.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-supervisor/v1.10/cluster-template-workload-supervisor.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-supervisor/v1.10/clusterclass-quick-start-supervisor.yaml"
- sourcePath: "../data/shared/capv/v1.10/metadata.yaml"
- name: "{go://sigs.k8s.io/cluster-api-provider-vsphere@v1.9}" # supported release in the v1beta1 series
value: "https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/download/{go://sigs.k8s.io/cluster-api-provider-vsphere@v1.9}/infrastructure-components.yaml"
Expand All @@ -175,6 +177,8 @@ providers:
# Add a cluster template
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-govmomi/v1.9/cluster-template-workload.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-govmomi/v1.9/clusterclass-quick-start.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-supervisor/v1.9/cluster-template-workload-supervisor.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-supervisor/v1.9/clusterclass-quick-start-supervisor.yaml"
- sourcePath: "../data/shared/capv/v1.9/metadata.yaml"

- name: vcsim
Expand Down Expand Up @@ -260,6 +264,9 @@ variables:
EXP_NODE_ANTI_AFFINITY: "true"
CAPI_DIAGNOSTICS_ADDRESS: ":8080"
CAPI_INSECURE_DIAGNOSTICS: "true"
# Required to be set to install capv-supervisor <= v1.10, but getting created.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand what "but getting created" means

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is required to install CAPV in supervisor mode to a management cluster for versions <= v1.10.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup that makes sense. I just can't parse the last part of the sentence :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine to address in a follow-up

SERVICE_ACCOUNTS_CM_NAMESPACE: "capv-system"
SERVICE_ACCOUNTS_CM_NAME: "service-accounts-cm"

intervals:
default/wait-controllers: ["5m", "10s"]
Expand Down
Loading
Loading