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
54feed4e
Commit
54feed4e
authored
Oct 25, 2016
by
Random-Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable remote dockershim by default. Once the grpc integration
is stablized, I'll remove the temporary knob and configure container runtime endpoint in all test suite.
parent
b1d8961f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
41 deletions
+31
-41
kubelet.go
pkg/kubelet/kubelet.go
+29
-39
kuberuntime_manager.go
pkg/kubelet/kuberuntime/kuberuntime_manager.go
+2
-2
No files found.
pkg/kubelet/kubelet.go
View file @
54feed4e
...
...
@@ -491,43 +491,32 @@ func NewMainKubelet(kubeCfg *componentconfig.KubeletConfiguration, kubeDeps *Kub
// Use the new CRI shim for docker. This is needed for testing the
// docker integration through CRI, and may be removed in the future.
dockerService
:=
dockershim
.
NewDockerService
(
klet
.
dockerClient
,
kubeCfg
.
SeccompProfileRoot
,
kubeCfg
.
PodInfraContainerImage
)
klet
.
containerRuntime
,
err
=
kuberuntime
.
NewKubeGenericRuntimeManager
(
kubecontainer
.
FilterEventRecorder
(
kubeDeps
.
Recorder
),
klet
.
livenessManager
,
containerRefManager
,
machineInfo
,
klet
.
podManager
,
kubeDeps
.
OSInterface
,
klet
.
networkPlugin
,
klet
,
klet
.
httpClient
,
imageBackOff
,
kubeCfg
.
SerializeImagePulls
,
float32
(
kubeCfg
.
RegistryPullQPS
),
int
(
kubeCfg
.
RegistryBurst
),
klet
.
cpuCFSQuota
,
dockerService
,
dockerService
,
)
if
err
!=
nil
{
return
nil
,
err
}
case
"remote"
:
// kubelet will talk to the shim over a unix socket using grpc. This may become the default in the near future.
dockerService
:=
dockershim
.
NewDockerService
(
klet
.
dockerClient
,
kubeCfg
.
SeccompProfileRoot
,
kubeCfg
.
PodInfraContainerImage
)
// Start the in process dockershim grpc server.
server
:=
dockerremote
.
NewDockerServer
(
kubeCfg
.
RemoteRuntimeEndpoint
,
dockerService
)
if
err
:=
server
.
Start
();
err
!=
nil
{
return
nil
,
err
}
// Start the remote kuberuntime manager.
remoteRuntimeService
,
err
:=
remote
.
NewRemoteRuntimeService
(
kubeCfg
.
RemoteRuntimeEndpoint
,
kubeCfg
.
RuntimeRequestTimeout
.
Duration
)
if
err
!=
nil
{
return
nil
,
err
}
remoteImageService
,
err
:=
remote
.
NewRemoteImageService
(
kubeCfg
.
RemoteImageEndpoint
,
kubeCfg
.
RuntimeRequestTimeout
.
Duration
)
if
err
!=
nil
{
return
nil
,
err
runtimeService
:=
dockerService
.
(
internalApi
.
RuntimeService
)
imageService
:=
dockerService
.
(
internalApi
.
ImageManagerService
)
// This is a temporary knob to easily switch between grpc and non-grpc integration. grpc
// will be enabled if this is not empty.
// TODO(random-liu): Remove the temporary knob after grpc integration is stabilized and
// pass the runtime endpoint through kubelet flags.
remoteEndpoint
:=
"/var/run/dockershim.sock"
// If the remote runtime endpoint is set, use the grpc integration.
if
remoteEndpoint
!=
""
{
// Start the in process dockershim grpc server.
server
:=
dockerremote
.
NewDockerServer
(
remoteEndpoint
,
dockerService
)
err
:=
server
.
Start
()
if
err
!=
nil
{
return
nil
,
err
}
// Start the remote kuberuntime manager.
runtimeService
,
err
=
remote
.
NewRemoteRuntimeService
(
remoteEndpoint
,
kubeCfg
.
RuntimeRequestTimeout
.
Duration
)
if
err
!=
nil
{
return
nil
,
err
}
imageService
,
err
=
remote
.
NewRemoteImageService
(
remoteEndpoint
,
kubeCfg
.
RuntimeRequestTimeout
.
Duration
)
if
err
!=
nil
{
return
nil
,
err
}
}
klet
.
containerRuntime
,
err
=
kuberuntime
.
NewKubeGenericRuntimeManager
(
kubecontainer
.
FilterEventRecorder
(
kubeDeps
.
Recorder
),
...
...
@@ -547,14 +536,15 @@ func NewMainKubelet(kubeCfg *componentconfig.KubeletConfiguration, kubeDeps *Kub
// Use DockerLegacyService directly to workaround unimplemented functions.
// We add short hack here to keep other code clean.
// TODO: Remove this hack after CRI is fully designed and implemented.
// TODO: Move the instrumented interface wrapping into kuberuntime.
&
struct
{
internalApi
.
RuntimeService
dockershim
.
DockerLegacyService
}{
RuntimeService
:
remoteRuntimeService
,
RuntimeService
:
kuberuntime
.
NewInstrumentedRuntimeService
(
runtimeService
)
,
DockerLegacyService
:
dockerService
,
},
remoteImageService
,
kuberuntime
.
NewInstrumentedImageManagerService
(
imageService
)
,
)
if
err
!=
nil
{
return
nil
,
err
...
...
pkg/kubelet/kuberuntime/kuberuntime_manager.go
View file @
54feed4e
...
...
@@ -138,8 +138,8 @@ func NewKubeGenericRuntimeManager(
osInterface
:
osInterface
,
networkPlugin
:
networkPlugin
,
runtimeHelper
:
runtimeHelper
,
runtimeService
:
NewInstrumentedRuntimeService
(
runtimeService
)
,
imageService
:
NewInstrumentedImageManagerService
(
imageService
)
,
runtimeService
:
runtimeService
,
imageService
:
imageService
,
keyring
:
credentialprovider
.
NewDockerKeyring
(),
}
...
...
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