Skip to content

Commit

Permalink
Add base InPlace upgrade flows for vSphere
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavmpandey08 committed Feb 14, 2024
1 parent 29a7470 commit bcb6669
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 4 deletions.
2 changes: 2 additions & 0 deletions test/e2e/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package e2e
import (
"github.com/aws/eks-anywhere/internal/pkg/api"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/features"
"github.com/aws/eks-anywhere/test/framework"
)

Expand Down Expand Up @@ -61,6 +62,7 @@ func runSimpleUpgradeFlowWorkerNodeVersionForBareMetal(test *framework.ClusterE2
}

func runInPlaceUpgradeFlow(test *framework.ClusterE2ETest, clusterOpts ...framework.ClusterE2ETestOpt) {
test.T.Setenv(features.VSphereInPlaceEnvVar, "true")
test.CreateCluster()
test.UpgradeClusterWithNewConfig(clusterOpts)
test.ValidateClusterState()
Expand Down
96 changes: 92 additions & 4 deletions test/e2e/vsphere_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3443,12 +3443,103 @@ func TestVSphereKubernetes127to128UpgradeFromLatestMinorReleaseBottleRocketAPI(t
)
}

func TestVSphereKubernetes125UbuntuTo126InPlaceUpgrade_1CP_1Worker(t *testing.T) {
provider := framework.NewVSphere(t, framework.WithUbuntu125())
test := framework.NewClusterE2ETest(
t,
provider,
framework.WithClusterFiller(
api.WithControlPlaneCount(1),
api.WithWorkerNodeCount(1),
api.WithStackedEtcdTopology(),
api.WithInPlaceUpgradeStrategy(),
),
).WithClusterConfig(
api.VSphereToConfigFiller(api.RemoveEtcdVsphereMachineConfig()),
provider.WithKubeVersionAndOS(v1alpha1.Kube125, framework.Ubuntu2004, nil),
)

runInPlaceUpgradeFlow(
test,
framework.WithClusterUpgrade(api.WithKubernetesVersion(v1alpha1.Kube126)),
provider.WithProviderUpgrade(provider.Ubuntu126Template()),
)
}

func TestVSphereKubernetes126UbuntuTo127InPlaceUpgrade_3CP_1Worker(t *testing.T) {
provider := framework.NewVSphere(t, framework.WithUbuntu126())
test := framework.NewClusterE2ETest(
t,
provider,
framework.WithClusterFiller(
api.WithControlPlaneCount(3),
api.WithWorkerNodeCount(1),
api.WithStackedEtcdTopology(),
api.WithInPlaceUpgradeStrategy(),
),
).WithClusterConfig(
api.VSphereToConfigFiller(api.RemoveEtcdVsphereMachineConfig()),
provider.WithKubeVersionAndOS(v1alpha1.Kube126, framework.Ubuntu2004, nil),
)

runInPlaceUpgradeFlow(
test,
framework.WithClusterUpgrade(api.WithKubernetesVersion(v1alpha1.Kube127)),
provider.WithProviderUpgrade(provider.Ubuntu127Template()),
)
}

func TestVSphereKubernetes127UbuntuTo128InPlaceUpgrade_1CP_3Worker(t *testing.T) {
provider := framework.NewVSphere(t, framework.WithUbuntu127())
test := framework.NewClusterE2ETest(
t,
provider,
framework.WithClusterFiller(
api.WithControlPlaneCount(1),
api.WithWorkerNodeCount(3),
api.WithStackedEtcdTopology(),
api.WithInPlaceUpgradeStrategy(),
),
).WithClusterConfig(
api.VSphereToConfigFiller(api.RemoveEtcdVsphereMachineConfig()),
provider.WithKubeVersionAndOS(v1alpha1.Kube127, framework.Ubuntu2004, nil),
)

runInPlaceUpgradeFlow(
test,
framework.WithClusterUpgrade(api.WithKubernetesVersion(v1alpha1.Kube128)),
provider.WithProviderUpgrade(provider.Ubuntu128Template()),
)
}

func TestVSphereKubernetes128UbuntuTo129InPlaceUpgrade_3CP_3Worker(t *testing.T) {
provider := framework.NewVSphere(t, framework.WithUbuntu128())
test := framework.NewClusterE2ETest(
t,
provider,
framework.WithClusterFiller(
api.WithControlPlaneCount(3),
api.WithWorkerNodeCount(3),
api.WithStackedEtcdTopology(),
api.WithInPlaceUpgradeStrategy(),
),
).WithClusterConfig(
api.VSphereToConfigFiller(api.RemoveEtcdVsphereMachineConfig()),
provider.WithKubeVersionAndOS(v1alpha1.Kube128, framework.Ubuntu2004, nil),
)

runInPlaceUpgradeFlow(
test,
framework.WithClusterUpgrade(api.WithKubernetesVersion(v1alpha1.Kube129)),
provider.WithProviderUpgrade(provider.Ubuntu129Template()),
)
}

func TestVSphereKubernetes128UbuntuInPlaceCPScaleUp1To3(t *testing.T) {
provider := framework.NewVSphere(t, framework.WithUbuntu128())
test := framework.NewClusterE2ETest(
t,
provider,
framework.WithEnvVar(features.VSphereInPlaceEnvVar, "true"),
).WithClusterConfig(
api.ClusterToConfigFiller(
api.WithKubernetesVersion(v1alpha1.Kube128),
Expand Down Expand Up @@ -3476,7 +3567,6 @@ func TestVSphereKubernetes128UbuntuInPlaceCPScaleDown3To1(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
provider,
framework.WithEnvVar(features.VSphereInPlaceEnvVar, "true"),
).WithClusterConfig(
api.ClusterToConfigFiller(
api.WithKubernetesVersion(v1alpha1.Kube128),
Expand Down Expand Up @@ -3504,7 +3594,6 @@ func TestVSphereKubernetes128UbuntuInPlaceWorkerScaleUp1To2(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
provider,
framework.WithEnvVar(features.VSphereInPlaceEnvVar, "true"),
).WithClusterConfig(
api.ClusterToConfigFiller(
api.WithKubernetesVersion(v1alpha1.Kube128),
Expand Down Expand Up @@ -3532,7 +3621,6 @@ func TestVSphereKubernetes128UbuntuInPlaceWorkerScaleDown2To1(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
provider,
framework.WithEnvVar(features.VSphereInPlaceEnvVar, "true"),
).WithClusterConfig(
api.ClusterToConfigFiller(
api.WithKubernetesVersion(v1alpha1.Kube128),
Expand Down

0 comments on commit bcb6669

Please sign in to comment.