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
ebdccb7b
Commit
ebdccb7b
authored
May 27, 2015
by
Quinton Hoole
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8889 from GoogleCloudPlatform/revert-8829-no-ro-nettest
Revert "Revert "Revert "Fix networking test"""
parents
851f6b75
30ffe032
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
29 deletions
+13
-29
Makefile
contrib/for-tests/network-tester/Makefile
+1
-1
rc.json
contrib/for-tests/network-tester/rc.json
+4
-8
webserver.go
contrib/for-tests/network-tester/webserver.go
+7
-19
networking.go
test/e2e/networking.go
+1
-1
No files found.
contrib/for-tests/network-tester/Makefile
View file @
ebdccb7b
all
:
push
all
:
push
# Set this to the *next* version to prevent accidentally overwriting the existing image.
# Set this to the *next* version to prevent accidentally overwriting the existing image.
TAG
=
1.
5
TAG
=
1.
4
webserver
:
webserver.go
webserver
:
webserver.go
CGO_ENABLED
=
0
GOOS
=
linux go build
-a
-installsuffix
cgo
-ldflags
'-w'
./webserver.go
CGO_ENABLED
=
0
GOOS
=
linux go build
-a
-installsuffix
cgo
-ldflags
'-w'
./webserver.go
...
...
contrib/for-tests/network-tester/rc.json
View file @
ebdccb7b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
}
}
},
},
"spec"
:
{
"spec"
:
{
"replicas"
:
2
,
"replicas"
:
8
,
"selector"
:
{
"selector"
:
{
"name"
:
"nettest"
"name"
:
"nettest"
},
},
...
@@ -22,13 +22,9 @@
...
@@ -22,13 +22,9 @@
"containers"
:
[
"containers"
:
[
{
{
"name"
:
"webserver"
,
"name"
:
"webserver"
,
"image"
:
"gcr.io/google_containers/nettest:1.4"
,
"image"
:
"gcr.io/google_containers/nettest:1.1"
,
"imagePullPolicy"
:
"Always"
,
"command"
:
[
"args"
:
[
"-service=nettest"
"-service=nettest"
,
"-port=8080"
,
"-namespace=default"
,
"-peers=2"
],
],
"ports"
:
[
"ports"
:
[
{
{
...
...
contrib/for-tests/network-tester/webserver.go
View file @
ebdccb7b
...
@@ -37,12 +37,13 @@ import (
...
@@ -37,12 +37,13 @@ import (
"io/ioutil"
"io/ioutil"
"log"
"log"
"math/rand"
"math/rand"
"net"
"net/http"
"net/http"
"net/url"
"os"
"os"
"sync"
"sync"
"time"
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
)
)
...
@@ -202,25 +203,12 @@ func main() {
...
@@ -202,25 +203,12 @@ 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
)
{
defer
state
.
doneContactingPeers
()
defer
state
.
doneContactingPeers
()
token
,
err
:=
ioutil
.
ReadFile
(
"/var/run/secrets/kubernetes.io/serviceaccount/token"
)
masterRO
:=
url
.
URL
{
if
err
!=
nil
{
Scheme
:
"http"
,
log
.
Fatalf
(
"Unable to read service account token: %v"
,
err
)
Host
:
os
.
Getenv
(
"KUBERNETES_RO_SERVICE_HOST"
)
+
":"
+
os
.
Getenv
(
"KUBERNETES_RO_SERVICE_PORT"
),
}
Path
:
"/api/"
+
latest
.
Version
,
cc
:=
client
.
Config
{
Host
:
"https://"
+
net
.
JoinHostPort
(
os
.
Getenv
(
"KUBERNETES_SERVICE_HOST"
),
os
.
Getenv
(
"KUBERNETES_SERVICE_PORT"
)),
Version
:
"v1beta3"
,
BearerToken
:
string
(
token
),
Insecure
:
true
,
// TOOD: package certs along with the token
}
client
,
err
:=
client
.
New
(
&
cc
)
if
err
!=
nil
{
log
.
Fatalf
(
"Unable to create client:
\n
config: %#v
\n
error: %v
\n
"
,
err
)
}
if
v
,
err
:=
client
.
ServerVersion
();
err
!=
nil
{
log
.
Fatalf
(
"Unable to get server version: %v
\n
"
,
err
)
}
else
{
log
.
Printf
(
"Server version: %#v
\n
"
,
v
)
}
}
client
:=
&
client
.
Client
{
client
.
NewRESTClient
(
&
masterRO
,
latest
.
Version
,
latest
.
Codec
,
false
,
5
,
10
)}
// Do this repeatedly, in case there's some propagation delay with getting
// Do this repeatedly, in case there's some propagation delay with getting
// newly started pods into the endpoints list.
// newly started pods into the endpoints list.
...
...
test/e2e/networking.go
View file @
ebdccb7b
...
@@ -50,7 +50,7 @@ func LaunchNetTestPodPerNode(f *Framework, nodes *api.NodeList, name string) []s
...
@@ -50,7 +50,7 @@ func LaunchNetTestPodPerNode(f *Framework, nodes *api.NodeList, name string) []s
Containers
:
[]
api
.
Container
{
Containers
:
[]
api
.
Container
{
{
{
Name
:
"webserver"
,
Name
:
"webserver"
,
Image
:
"gcr.io/google_containers/nettest:1.
4
"
,
Image
:
"gcr.io/google_containers/nettest:1.
3
"
,
Args
:
[]
string
{
Args
:
[]
string
{
"-service="
+
name
,
"-service="
+
name
,
//peers >= totalPods should be asserted by the container.
//peers >= totalPods should be asserted by the container.
...
...
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