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
fe185f5e
Commit
fe185f5e
authored
Oct 05, 2015
by
Alex Robinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14415 from mesosphere/sttts-code-dedup-kubelet-init
Preparation for Mesos kubelet code-deduplication
parents
52b8c40b
10f9a975
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
10 deletions
+18
-10
integration.go
cmd/integration/integration.go
+2
-2
server.go
cmd/kubelet/app/server.go
+11
-5
hollow-node.go
cmd/kubemark/hollow-node.go
+1
-1
service.go
contrib/mesos/pkg/executor/service/service.go
+4
-2
No files found.
cmd/integration/integration.go
View file @
fe185f5e
...
@@ -238,7 +238,7 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
...
@@ -238,7 +238,7 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
10
*
time
.
Second
,
/* SyncFrequency */
10
*
time
.
Second
,
/* SyncFrequency */
40
/* MaxPods */
)
40
/* MaxPods */
)
kubeletapp
.
RunKubelet
(
kcfg
,
nil
)
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.
...
@@ -270,7 +270,7 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
...
@@ -270,7 +270,7 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
40
/* MaxPods */
)
40
/* MaxPods */
)
kubeletapp
.
RunKubelet
(
kcfg
,
nil
)
kubeletapp
.
RunKubelet
(
kcfg
)
return
apiServer
.
URL
,
configFilePath
return
apiServer
.
URL
,
configFilePath
}
}
...
...
cmd/kubelet/app/server.go
View file @
fe185f5e
...
@@ -455,7 +455,7 @@ func (s *KubeletServer) Run(kcfg *KubeletConfig) error {
...
@@ -455,7 +455,7 @@ func (s *KubeletServer) Run(kcfg *KubeletConfig) error {
glog
.
Warning
(
err
)
glog
.
Warning
(
err
)
}
}
if
err
:=
RunKubelet
(
kcfg
,
nil
);
err
!=
nil
{
if
err
:=
RunKubelet
(
kcfg
);
err
!=
nil
{
return
err
return
err
}
}
...
@@ -663,7 +663,7 @@ func SimpleKubelet(client *client.Client,
...
@@ -663,7 +663,7 @@ func SimpleKubelet(client *client.Client,
// 2 Kubelet binary
// 2 Kubelet binary
// 3 Standalone 'kubernetes' binary
// 3 Standalone 'kubernetes' binary
// Eventually, #2 will be replaced with instances of #3
// Eventually, #2 will be replaced with instances of #3
func
RunKubelet
(
kcfg
*
KubeletConfig
,
builder
KubeletBuilder
)
error
{
func
RunKubelet
(
kcfg
*
KubeletConfig
)
error
{
kcfg
.
Hostname
=
nodeutil
.
GetHostname
(
kcfg
.
HostnameOverride
)
kcfg
.
Hostname
=
nodeutil
.
GetHostname
(
kcfg
.
HostnameOverride
)
if
len
(
kcfg
.
NodeName
)
==
0
{
if
len
(
kcfg
.
NodeName
)
==
0
{
...
@@ -712,8 +712,9 @@ func RunKubelet(kcfg *KubeletConfig, builder KubeletBuilder) error {
...
@@ -712,8 +712,9 @@ func RunKubelet(kcfg *KubeletConfig, builder KubeletBuilder) error {
credentialprovider
.
SetPreferredDockercfgPath
(
kcfg
.
RootDirectory
)
credentialprovider
.
SetPreferredDockercfgPath
(
kcfg
.
RootDirectory
)
builder
:=
kcfg
.
Builder
if
builder
==
nil
{
if
builder
==
nil
{
builder
=
c
reateAndInitKubelet
builder
=
C
reateAndInitKubelet
}
}
if
kcfg
.
OSInterface
==
nil
{
if
kcfg
.
OSInterface
==
nil
{
kcfg
.
OSInterface
=
kubecontainer
.
RealOS
{}
kcfg
.
OSInterface
=
kubecontainer
.
RealOS
{}
...
@@ -782,6 +783,7 @@ func makePodSourceConfig(kc *KubeletConfig) *config.PodConfig {
...
@@ -782,6 +783,7 @@ func makePodSourceConfig(kc *KubeletConfig) *config.PodConfig {
type
KubeletConfig
struct
{
type
KubeletConfig
struct
{
Address
net
.
IP
Address
net
.
IP
AllowPrivileged
bool
AllowPrivileged
bool
Builder
KubeletBuilder
CAdvisorInterface
cadvisor
.
Interface
CAdvisorInterface
cadvisor
.
Interface
CgroupRoot
string
CgroupRoot
string
Cloud
cloudprovider
.
Interface
Cloud
cloudprovider
.
Interface
...
@@ -824,6 +826,7 @@ type KubeletConfig struct {
...
@@ -824,6 +826,7 @@ type KubeletConfig struct {
OOMAdjuster
*
oom
.
OOMAdjuster
OOMAdjuster
*
oom
.
OOMAdjuster
OSInterface
kubecontainer
.
OSInterface
OSInterface
kubecontainer
.
OSInterface
PodCIDR
string
PodCIDR
string
PodConfig
*
config
.
PodConfig
PodInfraContainerImage
string
PodInfraContainerImage
string
Port
uint
Port
uint
ReadOnlyPort
uint
ReadOnlyPort
uint
...
@@ -846,7 +849,7 @@ type KubeletConfig struct {
...
@@ -846,7 +849,7 @@ type KubeletConfig struct {
VolumePlugins
[]
volume
.
VolumePlugin
VolumePlugins
[]
volume
.
VolumePlugin
}
}
func
c
reateAndInitKubelet
(
kc
*
KubeletConfig
)
(
k
KubeletBootstrap
,
pc
*
config
.
PodConfig
,
err
error
)
{
func
C
reateAndInitKubelet
(
kc
*
KubeletConfig
)
(
k
KubeletBootstrap
,
pc
*
config
.
PodConfig
,
err
error
)
{
// TODO: block until all sources have delivered at least one update to the channel, or break the sync loop
// TODO: block until all sources have delivered at least one update to the channel, or break the sync loop
// up into "per source" synchronizations
// up into "per source" synchronizations
// TODO: KubeletConfig.KubeClient should be a client interface, but client interface misses certain methods
// TODO: KubeletConfig.KubeClient should be a client interface, but client interface misses certain methods
...
@@ -867,7 +870,10 @@ func createAndInitKubelet(kc *KubeletConfig) (k KubeletBootstrap, pc *config.Pod
...
@@ -867,7 +870,10 @@ func createAndInitKubelet(kc *KubeletConfig) (k KubeletBootstrap, pc *config.Pod
KubeletEndpoint
:
api
.
DaemonEndpoint
{
Port
:
int
(
kc
.
Port
)},
KubeletEndpoint
:
api
.
DaemonEndpoint
{
Port
:
int
(
kc
.
Port
)},
}
}
pc
=
makePodSourceConfig
(
kc
)
pc
=
kc
.
PodConfig
if
pc
==
nil
{
pc
=
makePodSourceConfig
(
kc
)
}
k
,
err
=
kubelet
.
NewMainKubelet
(
k
,
err
=
kubelet
.
NewMainKubelet
(
kc
.
Hostname
,
kc
.
Hostname
,
kc
.
NodeName
,
kc
.
NodeName
,
...
...
cmd/kubemark/hollow-node.go
View file @
fe185f5e
...
@@ -130,7 +130,7 @@ func main() {
...
@@ -130,7 +130,7 @@ func main() {
10
*
time
.
Second
,
/* SyncFrequency */
10
*
time
.
Second
,
/* SyncFrequency */
40
,
/* MaxPods */
40
,
/* MaxPods */
)
)
kubeletapp
.
RunKubelet
(
kcfg
,
nil
)
kubeletapp
.
RunKubelet
(
kcfg
)
select
{}
select
{}
}
}
contrib/mesos/pkg/executor/service/service.go
View file @
fe185f5e
...
@@ -218,9 +218,11 @@ func (s *KubeletExecutorServer) Run(hks hyperkube.Interface, _ []string) error {
...
@@ -218,9 +218,11 @@ func (s *KubeletExecutorServer) Run(hks hyperkube.Interface, _ []string) error {
kcfg
.
NodeName
=
kcfg
.
Hostname
kcfg
.
NodeName
=
kcfg
.
Hostname
err
=
app
.
RunKubelet
(
&
kcfg
,
app
.
KubeletBuilder
(
func
(
kc
*
app
.
KubeletConfig
)
(
app
.
KubeletBootstrap
,
*
kconfig
.
PodConfig
,
error
)
{
kcfg
.
Builder
=
app
.
KubeletBuilder
(
func
(
kc
*
app
.
KubeletConfig
)
(
app
.
KubeletBootstrap
,
*
kconfig
.
PodConfig
,
error
)
{
return
s
.
createAndInitKubelet
(
kc
,
hks
,
clientConfig
)
return
s
.
createAndInitKubelet
(
kc
,
hks
,
clientConfig
)
}))
})
err
=
app
.
RunKubelet
(
&
kcfg
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
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