From 9cbbf3374e3d8f1ae4d014d37405e84a6e26a204 Mon Sep 17 00:00:00 2001 From: Priyank Upadhyay Date: Thu, 4 May 2023 13:49:29 +0530 Subject: [PATCH] fix(): added iperf app in ent-demo Signed-off-by: Priyank Upadhyay --- pkg/internal/print-next-steps.go | 18 ++++++++++++++---- pkg/slicectl.go | 7 +++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/pkg/internal/print-next-steps.go b/pkg/internal/print-next-steps.go index 290867a..251915b 100644 --- a/pkg/internal/print-next-steps.go +++ b/pkg/internal/print-next-steps.go @@ -33,13 +33,22 @@ Note: The DNS propagation may take a minute or two. ` const printEntVerificationStepsTemplate = ` ======================================================================== -KubeSlice Enterprise Setup (1 Controller + 2 Worker) is complete. +KubeSlice Enterprise Setup (1 Controller + 2 Worker) is complete +with a sample iPerf deployment. You can now access Kubeslice Manager UI using the following URL: %s %s To access Kubeslice Manager use the following token in the login screen: +%s %s + +Verify the iPerf Connectivity. +Here, the iPerf client, which is installed on Worker 1, will attempt to +reach out to iPerf service, which is installed on Worker 2. + +Note: The DNS propagation may take a minute or two. + %s %s ` @@ -104,6 +113,9 @@ func PrintNextSteps(verificationOnly bool, ApplicationConfiguration *Configurati func printVerificationSteps(ApplicationConfiguration *ConfigurationSpecs) { var template string username := "admin" + clusters := ApplicationConfiguration.Configuration.ClusterConfiguration.WorkerClusters + iperfCommand := exec.Command(util.ExecutablePaths["kubectl"], "--context="+clusters[1].ContextName, "--kubeconfig="+clusters[1].KubeConfigPath, "exec", "-it", "deploy/iperf-sleep", "-c", "iperf", "-n", "iperf", "--", "iperf", "-c", "iperf-server.iperf.svc.slice.local", "-p", "5201", "-i", "1", "-b", "10Mb;") + if ApplicationConfiguration.Configuration.ClusterConfiguration.Profile == ProfileEntDemo { token := GetUIAdminToken( &ApplicationConfiguration.Configuration.ClusterConfiguration.ControllerCluster, @@ -113,12 +125,10 @@ func printVerificationSteps(ApplicationConfiguration *ConfigurationSpecs) { template = fmt.Sprintf(printEntVerificationStepsTemplate, util.Globe, endpoint, util.Lock, token, + util.Run, iperfCommand.String(), ) } else { - - clusters := ApplicationConfiguration.Configuration.ClusterConfiguration.WorkerClusters - iperfCommand := exec.Command(util.ExecutablePaths["kubectl"], "--context="+clusters[1].ContextName, "--kubeconfig="+clusters[1].KubeConfigPath, "exec", "-it", "deploy/iperf-sleep", "-c", "iperf", "-n", "iperf", "--", "iperf", "-c", "iperf-server.iperf.svc.slice.local", "-p", "5201", "-i", "1", "-b", "10Mb;") template = fmt.Sprintf(printVerificationStepsTemplate, util.Run, iperfCommand.String(), ) diff --git a/pkg/slicectl.go b/pkg/slicectl.go index 9fe504f..92a2240 100644 --- a/pkg/slicectl.go +++ b/pkg/slicectl.go @@ -50,6 +50,13 @@ func entDemo() { internal.ApplySliceConfiguration(ApplicationConfiguration) util.Printf("%s Waiting for configuration propagation", util.Wait) time.Sleep(20 * time.Second) + internal.GenerateIPerfManifests() + internal.GenerateIPerfServiceExportManifest(ApplicationConfiguration) + internal.InstallIPerf(ApplicationConfiguration) + internal.ApplyIPerfServiceExportManifest(ApplicationConfiguration) + util.Printf("%s Waiting for configuration propagation", util.Wait) + time.Sleep(20 * time.Second) + internal.RolloutRestartIPerf(ApplicationConfiguration) internal.PrintNextSteps(true, ApplicationConfiguration) }