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
adc55115
Commit
adc55115
authored
Jun 09, 2016
by
k8s-merge-robot
Committed by
GitHub
Jun 09, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #27125 from wojtek-t/protobufs_in_nettest
Automatic merge from submit-queue Change webserver binary to be usable in large clusters. Ref #27039 @zmerlynn
parents
9ae6a008
12d1cc45
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
Makefile
test/images/network-tester/Makefile
+1
-1
webserver.go
test/images/network-tester/webserver.go
+23
-4
No files found.
test/images/network-tester/Makefile
View file @
adc55115
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
TAG
=
1.
8
TAG
=
1.
9
PREFIX
=
gcr.io/google_containers
PREFIX
=
gcr.io/google_containers
all
:
push
all
:
push
...
...
test/images/network-tester/webserver.go
View file @
adc55115
...
@@ -43,6 +43,7 @@ import (
...
@@ -43,6 +43,7 @@ import (
"syscall"
"syscall"
"time"
"time"
"k8s.io/kubernetes/pkg/client/restclient"
client
"k8s.io/kubernetes/pkg/client/unversioned"
client
"k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/sets"
)
)
...
@@ -214,9 +215,27 @@ func main() {
...
@@ -214,9 +215,27 @@ func main() {
// Find all sibling pods in the service and post to their /write handler.
// Find all sibling pods in the service and post to their /write handler.
func
contactOthers
(
state
*
State
)
{
func
contactOthers
(
state
*
State
)
{
const
waitTimeout
=
5
*
time
.
Minute
sleepTime
:=
5
*
time
.
Second
// In large cluster getting all endpoints is pretty expensive.
// Thus, we will limit ourselves to send on average at most 10 such
// requests per second
if
sleepTime
<
time
.
Duration
(
*
peerCount
/
10
)
*
time
.
Second
{
sleepTime
=
time
.
Duration
(
*
peerCount
/
10
)
*
time
.
Second
}
timeout
:=
5
*
time
.
Minute
// Similarly we need to bump timeout so that it is reasonable in large
// clusters.
if
timeout
<
time
.
Duration
(
*
peerCount
)
*
time
.
Second
{
timeout
=
time
.
Duration
(
*
peerCount
)
*
time
.
Second
}
defer
state
.
doneContactingPeers
()
defer
state
.
doneContactingPeers
()
client
,
err
:=
client
.
NewInCluster
()
config
,
err
:=
restclient
.
InClusterConfig
()
if
err
!=
nil
{
log
.
Fatalf
(
"Unable to create config; error: %v
\n
"
,
err
)
}
config
.
ContentType
=
"application/vnd.kubernetes.protobuf"
client
,
err
:=
client
.
New
(
config
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Fatalf
(
"Unable to create client; error: %v
\n
"
,
err
)
log
.
Fatalf
(
"Unable to create client; error: %v
\n
"
,
err
)
}
}
...
@@ -227,7 +246,7 @@ func contactOthers(state *State) {
...
@@ -227,7 +246,7 @@ func contactOthers(state *State) {
log
.
Printf
(
"Server version: %#v
\n
"
,
v
)
log
.
Printf
(
"Server version: %#v
\n
"
,
v
)
}
}
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
waitTimeout
;
time
.
Sleep
(
5
*
time
.
Second
)
{
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
timeout
;
time
.
Sleep
(
sleepTime
)
{
eps
:=
getWebserverEndpoints
(
client
)
eps
:=
getWebserverEndpoints
(
client
)
if
eps
.
Len
()
>=
*
peerCount
{
if
eps
.
Len
()
>=
*
peerCount
{
break
break
...
@@ -243,7 +262,7 @@ func contactOthers(state *State) {
...
@@ -243,7 +262,7 @@ func contactOthers(state *State) {
state
.
Logf
(
"Attempting to contact %s"
,
ep
)
state
.
Logf
(
"Attempting to contact %s"
,
ep
)
contactSingle
(
ep
,
state
)
contactSingle
(
ep
,
state
)
}
}
time
.
Sleep
(
5
*
time
.
Second
)
time
.
Sleep
(
sleepTime
)
}
}
}
}
...
...
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