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
29c6a3b5
Commit
29c6a3b5
authored
Sep 26, 2016
by
Harry Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enabel custom infracontainer image
Modify api protoc for infra
parent
a241daf3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
docker_sandbox.go
pkg/kubelet/dockershim/docker_sandbox.go
+7
-2
docker_service.go
pkg/kubelet/dockershim/docker_service.go
+3
-1
kubelet.go
pkg/kubelet/kubelet.go
+1
-1
No files found.
pkg/kubelet/dockershim/docker_sandbox.go
View file @
29c6a3b5
...
@@ -45,9 +45,14 @@ const (
...
@@ -45,9 +45,14 @@ const (
// Note: docker doesn't use LogDirectory (yet).
// Note: docker doesn't use LogDirectory (yet).
func
(
ds
*
dockerService
)
RunPodSandbox
(
config
*
runtimeApi
.
PodSandboxConfig
)
(
string
,
error
)
{
func
(
ds
*
dockerService
)
RunPodSandbox
(
config
*
runtimeApi
.
PodSandboxConfig
)
(
string
,
error
)
{
// Step 1: Pull the image for the sandbox.
// Step 1: Pull the image for the sandbox.
// TODO: How should we handle pulling custom pod infra container image
// (with credentials)?
image
:=
defaultSandboxImage
image
:=
defaultSandboxImage
podSandboxImage
:=
ds
.
podSandboxImage
if
len
(
podSandboxImage
)
!=
0
{
image
=
podSandboxImage
}
// NOTE: To use a custom sandbox image in a private repository, users need to configure the nodes with credentials properly.
// see: http://kubernetes.io/docs/user-guide/images/#configuring-nodes-to-authenticate-to-a-private-repository
if
err
:=
ds
.
client
.
PullImage
(
image
,
dockertypes
.
AuthConfig
{},
dockertypes
.
ImagePullOptions
{});
err
!=
nil
{
if
err
:=
ds
.
client
.
PullImage
(
image
,
dockertypes
.
AuthConfig
{},
dockertypes
.
ImagePullOptions
{});
err
!=
nil
{
return
""
,
fmt
.
Errorf
(
"unable to pull image for the sandbox container: %v"
,
err
)
return
""
,
fmt
.
Errorf
(
"unable to pull image for the sandbox container: %v"
,
err
)
}
}
...
...
pkg/kubelet/dockershim/docker_service.go
View file @
29c6a3b5
...
@@ -54,10 +54,11 @@ const (
...
@@ -54,10 +54,11 @@ const (
var
internalLabelKeys
[]
string
=
[]
string
{
containerTypeLabelKey
,
sandboxIDLabelKey
}
var
internalLabelKeys
[]
string
=
[]
string
{
containerTypeLabelKey
,
sandboxIDLabelKey
}
// NOTE: Anything passed to DockerService should be eventually handled in another way when we switch to running the shim as a different process.
// NOTE: Anything passed to DockerService should be eventually handled in another way when we switch to running the shim as a different process.
func
NewDockerService
(
client
dockertools
.
DockerInterface
,
seccompProfileRoot
string
)
DockerLegacyService
{
func
NewDockerService
(
client
dockertools
.
DockerInterface
,
seccompProfileRoot
string
,
podSandboxImage
string
)
DockerLegacyService
{
return
&
dockerService
{
return
&
dockerService
{
seccompProfileRoot
:
seccompProfileRoot
,
seccompProfileRoot
:
seccompProfileRoot
,
client
:
dockertools
.
NewInstrumentedDockerInterface
(
client
),
client
:
dockertools
.
NewInstrumentedDockerInterface
(
client
),
podSandboxImage
:
podSandboxImage
,
}
}
}
}
...
@@ -80,6 +81,7 @@ type DockerLegacyService interface {
...
@@ -80,6 +81,7 @@ type DockerLegacyService interface {
type
dockerService
struct
{
type
dockerService
struct
{
seccompProfileRoot
string
seccompProfileRoot
string
client
dockertools
.
DockerInterface
client
dockertools
.
DockerInterface
podSandboxImage
string
}
}
// Version returns the runtime name, runtime version and runtime API version
// Version returns the runtime name, runtime version and runtime API version
...
...
pkg/kubelet/kubelet.go
View file @
29c6a3b5
...
@@ -507,7 +507,7 @@ func NewMainKubelet(kubeCfg *componentconfig.KubeletConfiguration, kubeDeps *Kub
...
@@ -507,7 +507,7 @@ func NewMainKubelet(kubeCfg *componentconfig.KubeletConfiguration, kubeDeps *Kub
case
"cri"
:
case
"cri"
:
// Use the new CRI shim for docker. This is need for testing the
// Use the new CRI shim for docker. This is need for testing the
// docker integration through CRI, and may be removed in the future.
// docker integration through CRI, and may be removed in the future.
dockerService
:=
dockershim
.
NewDockerService
(
klet
.
dockerClient
,
kubeCfg
.
SeccompProfileRoot
)
dockerService
:=
dockershim
.
NewDockerService
(
klet
.
dockerClient
,
kubeCfg
.
SeccompProfileRoot
,
kubeCfg
.
PodInfraContainerImage
)
klet
.
containerRuntime
,
err
=
kuberuntime
.
NewKubeGenericRuntimeManager
(
klet
.
containerRuntime
,
err
=
kuberuntime
.
NewKubeGenericRuntimeManager
(
kubecontainer
.
FilterEventRecorder
(
kubeDeps
.
Recorder
),
kubecontainer
.
FilterEventRecorder
(
kubeDeps
.
Recorder
),
klet
.
livenessManager
,
klet
.
livenessManager
,
...
...
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