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
ce08973e
Commit
ce08973e
authored
Feb 26, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #22092 from pwittrock/node-e2e-enable-hosts
Auto commit by PR queue bot
parents
2bca7c52
0db31697
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
46 deletions
+52
-46
e2e_service.go
test/e2e_node/e2e_service.go
+51
-45
jenkins-pull.properties
test/e2e_node/jenkins/jenkins-pull.properties
+1
-1
No files found.
test/e2e_node/e2e_service.go
View file @
ce08973e
...
...
@@ -109,54 +109,51 @@ func (es *e2eService) startEtcd() (*exec.Cmd, error) {
return
nil
,
err
}
es
.
etcdDataDir
=
dataDir
return
es
.
startServer
(
healthCheckCommand
{
combinedOut
:
&
es
.
etcdCombinedOut
,
healthCheckUrl
:
"http://127.0.0.1:4001/v2/keys"
,
command
:
"etcd"
,
args
:
[]
string
{
"--data-dir"
,
dataDir
},
})
cmd
:=
exec
.
Command
(
"etcd"
)
// Execute etcd in the data directory instead of using --data-dir because the flag sometimes requires additional
// configuration (e.g. --name in version 0.4.9)
cmd
.
Dir
=
es
.
etcdDataDir
hcc
:=
newHealthCheckCommand
(
"http://127.0.0.1:4001/v2/keys/"
,
// Trailing slash is required,
cmd
,
&
es
.
etcdCombinedOut
)
return
cmd
,
es
.
startServer
(
hcc
)
}
func
(
es
*
e2eService
)
startApiServer
()
(
*
exec
.
Cmd
,
error
)
{
return
es
.
startServer
(
healthCheckCommand
{
combinedOut
:
&
es
.
apiServerCombinedOut
,
healthCheckUrl
:
"http://127.0.0.1:8080/healthz"
,
command
:
"sudo"
,
args
:
[]
string
{
getApiServerBin
(),
"--v"
,
"2"
,
"--logtostderr"
,
"--log_dir"
,
"./"
,
"--etcd-servers"
,
"http://127.0.0.1:4001"
,
"--insecure-bind-address"
,
"0.0.0.0"
,
"--service-cluster-ip-range"
,
"10.0.0.1/24"
,
"--kubelet-port"
,
"10250"
},
})
cmd
:=
exec
.
Command
(
"sudo"
,
getApiServerBin
(),
"--v"
,
"2"
,
"--logtostderr"
,
"--log_dir"
,
"./"
,
"--etcd-servers"
,
"http://127.0.0.1:4001"
,
"--insecure-bind-address"
,
"0.0.0.0"
,
"--service-cluster-ip-range"
,
"10.0.0.1/24"
,
"--kubelet-port"
,
"10250"
)
hcc
:=
newHealthCheckCommand
(
"http://127.0.0.1:8080/healthz"
,
cmd
,
&
es
.
apiServerCombinedOut
)
return
cmd
,
es
.
startServer
(
hcc
)
}
func
(
es
*
e2eService
)
startKubeletServer
()
(
*
exec
.
Cmd
,
error
)
{
return
es
.
startServer
(
healthCheckCommand
{
combinedOut
:
&
es
.
kubeletCombinedOut
,
healthCheckUrl
:
"http://127.0.0.1:10255/healthz"
,
command
:
"sudo"
,
args
:
[]
string
{
getKubeletServerBin
(),
"--v"
,
"2"
,
"--logtostderr"
,
"--log_dir"
,
"./"
,
"--api-servers"
,
"http://127.0.0.1:8080"
,
"--address"
,
"0.0.0.0"
,
"--port"
,
"10250"
,
"--hostname-override"
,
es
.
nodeName
,
// Required because hostname is inconsistent across hosts
},
})
cmd
:=
exec
.
Command
(
"sudo"
,
getKubeletServerBin
(),
"--v"
,
"2"
,
"--logtostderr"
,
"--log_dir"
,
"./"
,
"--api-servers"
,
"http://127.0.0.1:8080"
,
"--address"
,
"0.0.0.0"
,
"--port"
,
"10250"
,
"--hostname-override"
,
es
.
nodeName
)
// Required because hostname is inconsistent across hosts
hcc
:=
newHealthCheckCommand
(
"http://127.0.0.1:10255/healthz"
,
cmd
,
&
es
.
kubeletCombinedOut
)
return
cmd
,
es
.
startServer
(
hcc
)
}
func
(
es
*
e2eService
)
startServer
(
hcc
healthCheckCommand
)
(
*
exec
.
Cmd
,
error
)
{
func
(
es
*
e2eService
)
startServer
(
cmd
*
healthCheckCommand
)
error
{
cmdErrorChan
:=
make
(
chan
error
)
cmd
:=
exec
.
Command
(
hcc
.
command
,
hcc
.
args
...
)
cmd
.
Stdout
=
hcc
.
combinedOut
cmd
.
Stderr
=
hcc
.
combinedOut
go
func
()
{
err
:=
cmd
.
Run
()
if
err
!=
nil
{
cmdErrorChan
<-
fmt
.
Errorf
(
"%
v Exited with status %v. Output:
\n
%s"
,
hcc
,
err
,
*
hcc
.
combinedOut
)
cmdErrorChan
<-
fmt
.
Errorf
(
"%
s Exited with status %v. Output:
\n
%s"
,
cmd
,
err
,
*
cmd
.
OutputBuffer
)
}
close
(
cmdErrorChan
)
}()
...
...
@@ -165,24 +162,33 @@ func (es *e2eService) startServer(hcc healthCheckCommand) (*exec.Cmd, error) {
for
endTime
.
After
(
time
.
Now
())
{
select
{
case
err
:=
<-
cmdErrorChan
:
return
nil
,
err
return
err
case
<-
time
.
After
(
time
.
Second
)
:
resp
,
err
:=
http
.
Get
(
hcc
.
h
ealthCheckUrl
)
resp
,
err
:=
http
.
Get
(
cmd
.
H
ealthCheckUrl
)
if
err
==
nil
&&
resp
.
StatusCode
==
http
.
StatusOK
{
return
cmd
,
nil
return
nil
}
}
}
return
nil
,
fmt
.
Errorf
(
"Timeout waiting for service %v"
,
hcc
)
return
fmt
.
Errorf
(
"Timeout waiting for service %s"
,
cmd
)
}
type
healthCheckCommand
struct
{
healthCheckUrl
string
command
string
args
[]
string
combinedOut
*
bytes
.
Buffer
*
exec
.
Cmd
HealthCheckUrl
string
OutputBuffer
*
bytes
.
Buffer
}
func
newHealthCheckCommand
(
healthCheckUrl
string
,
cmd
*
exec
.
Cmd
,
combinedOutput
*
bytes
.
Buffer
)
*
healthCheckCommand
{
cmd
.
Stdout
=
combinedOutput
cmd
.
Stderr
=
combinedOutput
return
&
healthCheckCommand
{
HealthCheckUrl
:
healthCheckUrl
,
Cmd
:
cmd
,
OutputBuffer
:
combinedOutput
,
}
}
func
(
hcc
*
healthCheckCommand
)
String
()
string
{
return
fmt
.
Sprintf
(
"`%s %s`
%s"
,
hcc
.
command
,
strings
.
Join
(
hcc
.
args
,
" "
),
hcc
.
h
ealthCheckUrl
)
return
fmt
.
Sprintf
(
"`%s %s`
health-check: %s"
,
hcc
.
Path
,
strings
.
Join
(
hcc
.
Args
,
" "
),
hcc
.
H
ealthCheckUrl
)
}
test/e2e_node/jenkins/jenkins-pull.properties
View file @
ce08973e
GCE_HOSTS
=
GCE_IMAGES
=
e2e-node-ubuntu-trusty-docker10-image,e2e-node-ubuntu-trusty-docker9-image,e2e-node-ubuntu-trusty-docker8-image
GCE_IMAGES
=
e2e-node-ubuntu-trusty-docker10-image,e2e-node-ubuntu-trusty-docker9-image,e2e-node-ubuntu-trusty-docker8-image
,e2e-node-coreos-stable20160218-image,e2e-node-containervm-20160217-image
GCE_ZONE
=
us-central1-f
GCE_PROJECT
=
kubernetes-jenkins-pull
INSTALL_GODEP
=
true
...
...
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