From 3768d8a9a3718d982a38f760e5bde45cc786e747 Mon Sep 17 00:00:00 2001 From: Shyam Jeedigunta Date: Mon, 18 Jun 2018 14:59:45 +0200 Subject: [PATCH 1/2] Half the no. of endpoints in load test --- test/e2e/scalability/load.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/e2e/scalability/load.go b/test/e2e/scalability/load.go index 5dadeed360f..7cfe4b68e48 100644 --- a/test/e2e/scalability/load.go +++ b/test/e2e/scalability/load.go @@ -535,8 +535,11 @@ func GenerateConfigsForGroup( MemRequest: 26214400, // 25MB SecretNames: secretNames, ConfigMapNames: configMapNames, - // Define a label to group every 2 RCs into one service. - Labels: map[string]string{svcLabelKey: groupName + "-" + strconv.Itoa((i+1)/2)}, + } + + // Add a label to alternate RCs, to include only half of them in services. + if i%2 == 0 { + baseConfig.Labels = map[string]string{svcLabelKey: groupName + "-" + strconv.Itoa(i/2)} } if kind == randomKind { From a01dea5df04664df808495558408df6b5b173ed6 Mon Sep 17 00:00:00 2001 From: Shyam Jeedigunta Date: Mon, 18 Jun 2018 15:46:14 +0200 Subject: [PATCH 2/2] Make no. of services in load test configurable --- test/e2e/scalability/load.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/test/e2e/scalability/load.go b/test/e2e/scalability/load.go index 7cfe4b68e48..8447a126b5c 100644 --- a/test/e2e/scalability/load.go +++ b/test/e2e/scalability/load.go @@ -492,6 +492,17 @@ func GenerateConfigsForGroup( secretConfigs := make([]*testutils.SecretConfig, 0, count*secretsPerPod) configMapConfigs := make([]*testutils.ConfigMapConfig, 0, count*configMapsPerPod) savedKind := kind + + // We assume by default that every RC is part of its own service. + // However, you can override it using SERVICE_TO_RC_RATIO env var. + serviceToRCRatio := 1.0 + if serviceToRCRatioEnv := os.Getenv("SERVICE_TO_RC_RATIO"); serviceToRCRatioEnv != "" { + if value, err := strconv.ParseFloat(serviceToRCRatioEnv, 64); err == nil { + serviceToRCRatio = value + } + } + numServices := int(float64(count) * serviceToRCRatio) + for i := 1; i <= count; i++ { kind = savedKind namespace := nss[i%len(nss)].Name @@ -537,9 +548,9 @@ func GenerateConfigsForGroup( ConfigMapNames: configMapNames, } - // Add a label to alternate RCs, to include only half of them in services. - if i%2 == 0 { - baseConfig.Labels = map[string]string{svcLabelKey: groupName + "-" + strconv.Itoa(i/2)} + // Add a label to first 'numServices' RCs (to include them in services). + if i <= numServices { + baseConfig.Labels = map[string]string{svcLabelKey: groupName + "-" + strconv.Itoa(i)} } if kind == randomKind {