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
bd12cfea
Commit
bd12cfea
authored
Mar 22, 2015
by
Clayton Coleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integration tests should do a faster status sync loop
parent
d8223ff9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
integration.go
cmd/integration/integration.go
+6
-2
server.go
cmd/kubelet/app/server.go
+3
-3
kubernetes.go
cmd/kubernetes/kubernetes.go
+2
-1
No files found.
cmd/integration/integration.go
View file @
bd12cfea
...
@@ -222,13 +222,17 @@ func startComponents(manifestURL, apiVersion string) (string, string) {
...
@@ -222,13 +222,17 @@ func startComponents(manifestURL, apiVersion string) (string, string) {
testRootDir
:=
makeTempDirOrDie
(
"kubelet_integ_1."
,
""
)
testRootDir
:=
makeTempDirOrDie
(
"kubelet_integ_1."
,
""
)
configFilePath
:=
makeTempDirOrDie
(
"config"
,
testRootDir
)
configFilePath
:=
makeTempDirOrDie
(
"config"
,
testRootDir
)
glog
.
Infof
(
"Using %s as root dir for kubelet #1"
,
testRootDir
)
glog
.
Infof
(
"Using %s as root dir for kubelet #1"
,
testRootDir
)
kubeletapp
.
SimpleRunKubelet
(
cl
,
&
fakeDocker1
,
machineList
[
0
],
testRootDir
,
manifestURL
,
"127.0.0.1"
,
10250
,
api
.
NamespaceDefault
,
empty_dir
.
ProbeVolumePlugins
(),
nil
,
cadvisorInterface
,
configFilePath
)
kcfg
:=
kubeletapp
.
SimpleKubelet
(
cl
,
&
fakeDocker1
,
machineList
[
0
],
testRootDir
,
manifestURL
,
"127.0.0.1"
,
10250
,
api
.
NamespaceDefault
,
empty_dir
.
ProbeVolumePlugins
(),
nil
,
cadvisorInterface
,
configFilePath
)
kcfg
.
PodStatusUpdateFrequency
=
1
*
time
.
Second
kubeletapp
.
RunKubelet
(
kcfg
)
// Kubelet (machine)
// Kubelet (machine)
// Create a second kubelet so that the guestbook example's two redis slaves both
// Create a second kubelet so that the guestbook example's two redis slaves both
// have a place they can schedule.
// have a place they can schedule.
testRootDir
=
makeTempDirOrDie
(
"kubelet_integ_2."
,
""
)
testRootDir
=
makeTempDirOrDie
(
"kubelet_integ_2."
,
""
)
glog
.
Infof
(
"Using %s as root dir for kubelet #2"
,
testRootDir
)
glog
.
Infof
(
"Using %s as root dir for kubelet #2"
,
testRootDir
)
kubeletapp
.
SimpleRunKubelet
(
cl
,
&
fakeDocker2
,
machineList
[
1
],
testRootDir
,
""
,
"127.0.0.1"
,
10251
,
api
.
NamespaceDefault
,
empty_dir
.
ProbeVolumePlugins
(),
nil
,
cadvisorInterface
,
""
)
kcfg
=
kubeletapp
.
SimpleKubelet
(
cl
,
&
fakeDocker2
,
machineList
[
1
],
testRootDir
,
""
,
"127.0.0.1"
,
10251
,
api
.
NamespaceDefault
,
empty_dir
.
ProbeVolumePlugins
(),
nil
,
cadvisorInterface
,
""
)
kcfg
.
PodStatusUpdateFrequency
=
1
*
time
.
Second
kubeletapp
.
RunKubelet
(
kcfg
)
return
apiServer
.
URL
,
configFilePath
return
apiServer
.
URL
,
configFilePath
}
}
...
...
cmd/kubelet/app/server.go
View file @
bd12cfea
...
@@ -262,7 +262,7 @@ func (s *KubeletServer) createAPIServerClient() (*client.Client, error) {
...
@@ -262,7 +262,7 @@ func (s *KubeletServer) createAPIServerClient() (*client.Client, error) {
// SimpleRunKubelet is a simple way to start a Kubelet talking to dockerEndpoint, using an API Client.
// SimpleRunKubelet is a simple way to start a Kubelet talking to dockerEndpoint, using an API Client.
// Under the hood it calls RunKubelet (below)
// Under the hood it calls RunKubelet (below)
func
Simple
Run
Kubelet
(
client
*
client
.
Client
,
func
SimpleKubelet
(
client
*
client
.
Client
,
dockerClient
dockertools
.
DockerInterface
,
dockerClient
dockertools
.
DockerInterface
,
hostname
,
rootDir
,
manifestURL
,
address
string
,
hostname
,
rootDir
,
manifestURL
,
address
string
,
port
uint
,
port
uint
,
...
@@ -270,7 +270,7 @@ func SimpleRunKubelet(client *client.Client,
...
@@ -270,7 +270,7 @@ func SimpleRunKubelet(client *client.Client,
volumePlugins
[]
volume
.
VolumePlugin
,
volumePlugins
[]
volume
.
VolumePlugin
,
tlsOptions
*
kubelet
.
TLSOptions
,
tlsOptions
*
kubelet
.
TLSOptions
,
cadvisorInterface
cadvisor
.
Interface
,
cadvisorInterface
cadvisor
.
Interface
,
configFilePath
string
)
{
configFilePath
string
)
*
KubeletConfig
{
imageGCPolicy
:=
kubelet
.
ImageGCPolicy
{
imageGCPolicy
:=
kubelet
.
ImageGCPolicy
{
HighThresholdPercent
:
90
,
HighThresholdPercent
:
90
,
...
@@ -302,7 +302,7 @@ func SimpleRunKubelet(client *client.Client,
...
@@ -302,7 +302,7 @@ func SimpleRunKubelet(client *client.Client,
ConfigFile
:
configFilePath
,
ConfigFile
:
configFilePath
,
ImageGCPolicy
:
imageGCPolicy
,
ImageGCPolicy
:
imageGCPolicy
,
}
}
RunKubelet
(
&
kcfg
)
return
&
kcfg
}
}
// RunKubelet is responsible for setting up and running a kubelet. It is used in three different applications:
// RunKubelet is responsible for setting up and running a kubelet. It is used in three different applications:
...
...
cmd/kubernetes/kubernetes.go
View file @
bd12cfea
...
@@ -150,7 +150,8 @@ func startComponents(etcdClient tools.EtcdClient, cl *client.Client, addr net.IP
...
@@ -150,7 +150,8 @@ func startComponents(etcdClient tools.EtcdClient, cl *client.Client, addr net.IP
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Fatalf
(
"Failed to create cAdvisor: %v"
,
err
)
glog
.
Fatalf
(
"Failed to create cAdvisor: %v"
,
err
)
}
}
kubeletapp
.
SimpleRunKubelet
(
cl
,
dockerClient
,
machineList
[
0
],
"/tmp/kubernetes"
,
""
,
"127.0.0.1"
,
10250
,
*
masterServiceNamespace
,
kubeletapp
.
ProbeVolumePlugins
(),
nil
,
cadvisorInterface
,
""
)
kcfg
:=
kubeletapp
.
SimpleKubelet
(
cl
,
dockerClient
,
machineList
[
0
],
"/tmp/kubernetes"
,
""
,
"127.0.0.1"
,
10250
,
*
masterServiceNamespace
,
kubeletapp
.
ProbeVolumePlugins
(),
nil
,
cadvisorInterface
,
""
)
kubeletapp
.
RunKubelet
(
kcfg
)
}
}
func
newApiClient
(
addr
net
.
IP
,
port
int
)
*
client
.
Client
{
func
newApiClient
(
addr
net
.
IP
,
port
int
)
*
client
.
Client
{
...
...
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