diff --git a/.github/workflows/scale-test.yaml b/.github/workflows/scale-test.yaml index 36a70fe84d..ad586aaf25 100644 --- a/.github/workflows/scale-test.yaml +++ b/.github/workflows/scale-test.yaml @@ -17,6 +17,13 @@ on: image_tag: description: "Image Tag (if not set, default for this commit will be used)" type: string + control_plane: + description: "Control Plane" + type: choice + required: true + options: + - "legacy" + - "hubble" num_deployments: description: "Number of Traffic Deployments" default: 1000 @@ -100,6 +107,7 @@ jobs: IMAGE_NAMESPACE: ${{ github.repository }} TAG: ${{ inputs.image_tag }} AZURE_APP_INSIGHTS_KEY: ${{ secrets.AZURE_APP_INSIGHTS_KEY }} + HUBBLE_CONTROL_PLANE: ${{ inputs.control_plane == 'hubble' }} shell: bash run: | set -euo pipefail diff --git a/test/e2e/common/common.go b/test/e2e/common/common.go index 4bb1336b55..d81ae258b3 100644 --- a/test/e2e/common/common.go +++ b/test/e2e/common/common.go @@ -8,6 +8,7 @@ import ( "flag" "os" "os/user" + "path/filepath" "strconv" "testing" "time" @@ -46,3 +47,19 @@ func ClusterNameForE2ETest(t *testing.T) string { } return clusterName } + +func RetinaChartPath(hubbleControlPlane bool) (string, error) { + cwd, err := os.Getwd() + if err != nil { + return "", err + } + + rootDir := filepath.Dir(filepath.Dir(cwd)) + controlPlane := "legacy" + + if hubbleControlPlane { + controlPlane = "hubble" + } + + return filepath.Join(rootDir, "deploy", controlPlane, "manifests", "controller", "helm", "retina"), nil +} diff --git a/test/e2e/jobs/jobs.go b/test/e2e/jobs/jobs.go index ddc58b5daf..8c7b3c4b6d 100644 --- a/test/e2e/jobs/jobs.go +++ b/test/e2e/jobs/jobs.go @@ -80,8 +80,23 @@ func DeleteTestInfra(subID, rg, clusterName, location string) *types.Job { return job } -func InstallRetina(kubeConfigFilePath, chartPath string) *types.Job { - job := types.NewJob("Install and test Retina with basic metrics") +func InstallRetina(kubeConfigFilePath, chartPath string, hubbleControlPlane bool) *types.Job { + if hubbleControlPlane { + job := types.NewJob("Install Retina with Hubble Control Plane") + + // Install Retina with Hubble Control Plane + job.AddStep(&kubernetes.ValidateHubbleStep{ + Namespace: common.KubeSystemNamespace, + ReleaseName: "retina", + KubeConfigFilePath: kubeConfigFilePath, + ChartPath: chartPath, + TagEnv: generic.DefaultTagEnv, + }, nil) + + return job + } + + job := types.NewJob("Install Retina with Legacy Control Plane") job.AddStep(&kubernetes.InstallHelmChart{ Namespace: common.KubeSystemNamespace, @@ -365,4 +380,3 @@ func RunPerfTest(kubeConfigFilePath string, chartPath string) *types.Job { return job } - diff --git a/test/e2e/scale_test.go b/test/e2e/scale_test.go index 6769dccc09..70f0d9f127 100644 --- a/test/e2e/scale_test.go +++ b/test/e2e/scale_test.go @@ -8,6 +8,7 @@ import ( "os" "path/filepath" "strconv" + "strings" "testing" "github.com/microsoft/retina/test/e2e/common" @@ -49,7 +50,6 @@ func TestE2ERetina_Scale(t *testing.T) { // Get to root of the repo by going up two directories rootDir := filepath.Dir(filepath.Dir(cwd)) - chartPath := filepath.Join(rootDir, "deploy", "legacy", "manifests", "controller", "helm", "retina") kubeConfigFilePath := filepath.Join(rootDir, "test", "e2e", "test.pem") // Scale test parameters @@ -103,8 +103,16 @@ func TestE2ERetina_Scale(t *testing.T) { require.NoError(t, err) opt.AdditionalTelemetryProperty["clusterFqdn"] = fqdn + var hubbleControlPlane bool + if strings.ToLower(os.Getenv("HUBBLE_CONTROL_PLANE")) == "true" { + hubbleControlPlane = true + } + + chartPath, err := common.RetinaChartPath(hubbleControlPlane) + require.NoError(t, err) + // Install Retina - installRetina := types.NewRunner(t, jobs.InstallRetina(kubeConfigFilePath, chartPath)) + installRetina := types.NewRunner(t, jobs.InstallRetina(kubeConfigFilePath, chartPath, hubbleControlPlane)) installRetina.Run(ctx) t.Cleanup(func() {