Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
26006af4
Commit
26006af4
authored
Jul 14, 2017
by
Shyam Jeedigunta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Group every two services into one in load test
parent
8e5584fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
load.go
test/e2e/scalability/load.go
+14
-2
runners.go
test/utils/runners.go
+6
-0
No files found.
test/e2e/scalability/load.go
View file @
26006af4
...
...
@@ -61,6 +61,7 @@ const (
nodeCountPerNamespace
=
100
// How many threads will be used to create/delete services during this test.
serviceOperationsParallelism
=
1
svcLabelKey
=
"svc-label"
)
var
randomKind
=
schema
.
GroupKind
{
Kind
:
"Random"
}
...
...
@@ -458,6 +459,8 @@ 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
)},
}
if
kind
==
randomKind
{
...
...
@@ -483,10 +486,19 @@ func GenerateConfigsForGroup(
}
func
generateServicesForConfigs
(
configs
[]
testutils
.
RunObjectConfig
)
[]
*
v1
.
Service
{
services
:=
make
([]
*
v1
.
Service
,
0
,
len
(
configs
))
services
:=
make
([]
*
v1
.
Service
,
0
)
currentSvcLabel
:=
""
for
_
,
config
:=
range
configs
{
svcLabel
,
found
:=
config
.
GetLabelValue
(
svcLabelKey
)
if
!
found
||
svcLabel
==
currentSvcLabel
{
continue
}
currentSvcLabel
=
svcLabel
serviceName
:=
config
.
GetName
()
+
"-svc"
labels
:=
map
[
string
]
string
{
"name"
:
config
.
GetName
()}
labels
:=
map
[
string
]
string
{
"name"
:
config
.
GetName
(),
svcLabelKey
:
currentSvcLabel
,
}
service
:=
&
v1
.
Service
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
serviceName
,
...
...
test/utils/runners.go
View file @
26006af4
...
...
@@ -108,6 +108,7 @@ type RunObjectConfig interface {
SetClient
(
clientset
.
Interface
)
SetInternalClient
(
internalclientset
.
Interface
)
GetReplicas
()
int
GetLabelValue
(
string
)
(
string
,
bool
)
}
type
RCConfig
struct
{
...
...
@@ -500,6 +501,11 @@ func (config *RCConfig) GetReplicas() int {
return
config
.
Replicas
}
func
(
config
*
RCConfig
)
GetLabelValue
(
key
string
)
(
string
,
bool
)
{
value
,
found
:=
config
.
Labels
[
key
]
return
value
,
found
}
func
(
config
*
RCConfig
)
create
()
error
{
dnsDefault
:=
v1
.
DNSDefault
if
config
.
DNSPolicy
==
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment