diff --git a/test/e2e/autoscaler.go b/test/e2e/autoscaler.go index a230b7a5c044..c98925e90699 100644 --- a/test/e2e/autoscaler.go +++ b/test/e2e/autoscaler.go @@ -7,12 +7,28 @@ import ( "github.com/aws/eks-anywhere/test/framework" ) +const ( + autoscalerName = "cluster-autoscaler" + metricServerName = "metrics-server" + targetNamespace = "eksa-packages" +) + func runAutoscalerWithMetricsServerSimpleFlow(test *framework.ClusterE2ETest) { test.WithCluster(func(e *framework.ClusterE2ETest) { - autoscalerName := "cluster-autoscaler" - metricServerName := "metrics-server" - targetNamespace := "eksa-packages" test.InstallAutoScalerWithMetricServer(targetNamespace) test.CombinedAutoScalerMetricServerTest(autoscalerName, metricServerName, targetNamespace, withMgmtCluster(test)) }) } + +func runAutoscalerWithMetricsServerTinkerbellSimpleFlow(test *framework.ClusterE2ETest) { + test.GenerateHardwareConfig() + test.PowerOffHardware() + test.GenerateClusterConfig() + test.PowerOnHardware() + test.CreateCluster(framework.WithControlPlaneWaitTimeout("20m")) + test.InstallAutoScalerWithMetricServer(targetNamespace) + test.CombinedAutoScalerMetricServerTest(autoscalerName, metricServerName, targetNamespace, withMgmtCluster(test)) + test.DeleteCluster() + test.PowerOffHardware() + test.ValidateHardwareDecommissioned() +} diff --git a/test/e2e/tinkerbell_test.go b/test/e2e/tinkerbell_test.go index 6d627a94c486..7d3d3944559f 100644 --- a/test/e2e/tinkerbell_test.go +++ b/test/e2e/tinkerbell_test.go @@ -441,7 +441,7 @@ func TestTinkerbellKubernetes127UbuntuCuratedPackagesClusterAutoscalerSimpleFlow EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI, EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues, nil), ) - runAutoscalerWithMetricsServerSimpleFlow(test) + runAutoscalerWithMetricsServerTinkerbellSimpleFlow(test) } func TestTinkerbellKubernetes126UbuntuSingleNodeCuratedPackagesFlow(t *testing.T) { @@ -953,7 +953,7 @@ func TestTinkerbellKubernetes128UbuntuCuratedPackagesClusterAutoscalerSimpleFlow EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI, EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues, nil), ) - runAutoscalerWithMetricsServerSimpleFlow(test) + runAutoscalerWithMetricsServerTinkerbellSimpleFlow(test) } // Single node diff --git a/test/framework/cluster.go b/test/framework/cluster.go index ab978f22d4e7..148ed516b842 100644 --- a/test/framework/cluster.go +++ b/test/framework/cluster.go @@ -2016,7 +2016,7 @@ func (e *ClusterE2ETest) CombinedAutoScalerMetricServerTest(autoscalerName, metr e.T.Fatalf("Failed waiting for test workload deployent %s", err) } - params := []string{"autoscale", "deployment", name, "--cpu-percent=50", "--min=1", "--max=20", "--kubeconfig", e.KubeconfigFilePath()} + params := []string{"autoscale", "deployment", name, "--cpu-percent=50", "--min=1", "--max=150", "--kubeconfig", e.KubeconfigFilePath()} _, err = e.KubectlClient.ExecuteCommand(ctx, params...) if err != nil { e.T.Fatalf("Failed to autoscale deployent: %s", err) diff --git a/test/framework/testdata/hpa_busybox.yaml b/test/framework/testdata/hpa_busybox.yaml index 55d690289be1..9401280deff4 100644 --- a/test/framework/testdata/hpa_busybox.yaml +++ b/test/framework/testdata/hpa_busybox.yaml @@ -20,7 +20,7 @@ spec: cpu: 50m requests: cpu: 10m - memory: 500Mi + memory: 1000Mi command: ["sh", "-c"] args: - while [ 1 ]; do