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
3481db8a
Commit
3481db8a
authored
May 12, 2015
by
Victor Marmol
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8136 from yifan-gu/runtime_opt
kubelet/container: Remove ipcMode and netMode from RunContainerOptions.
parents
4c6a4fc1
a2dac158
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
20 deletions
+15
-20
helpers.go
pkg/kubelet/container/helpers.go
+1
-2
runtime.go
pkg/kubelet/container/runtime.go
+0
-7
manager.go
pkg/kubelet/dockertools/manager.go
+12
-5
kubelet.go
pkg/kubelet/kubelet.go
+2
-6
No files found.
pkg/kubelet/container/helpers.go
View file @
3481db8a
...
@@ -30,9 +30,8 @@ type HandlerRunner interface {
...
@@ -30,9 +30,8 @@ type HandlerRunner interface {
// RunContainerOptionsGenerator generates the options that necessary for
// RunContainerOptionsGenerator generates the options that necessary for
// container runtime to run a container.
// container runtime to run a container.
// TODO(yifan): Remove netMode, ipcMode.
type
RunContainerOptionsGenerator
interface
{
type
RunContainerOptionsGenerator
interface
{
GenerateRunContainerOptions
(
pod
*
api
.
Pod
,
container
*
api
.
Container
,
netMode
,
ipcMode
string
)
(
*
RunContainerOptions
,
error
)
GenerateRunContainerOptions
(
pod
*
api
.
Pod
,
container
*
api
.
Container
)
(
*
RunContainerOptions
,
error
)
}
}
// Trims runtime prefix from ID or image name (e.g.: docker://busybox -> busybox).
// Trims runtime prefix from ID or image name (e.g.: docker://busybox -> busybox).
...
...
pkg/kubelet/container/runtime.go
View file @
3481db8a
...
@@ -201,13 +201,6 @@ type RunContainerOptions struct {
...
@@ -201,13 +201,6 @@ type RunContainerOptions struct {
DNS
[]
string
DNS
[]
string
// The list of DNS search domains.
// The list of DNS search domains.
DNSSearch
[]
string
DNSSearch
[]
string
// Docker namespace identifiers(currently we have 'NetMode' and 'IpcMode'.
// These are for docker to attach a container in a pod to the pod infra
// container's namespace.
// TODO(yifan): Remove these after we pushed the pod infra container logic
// into docker's container runtime.
NetMode
string
IpcMode
string
// The parent cgroup to pass to Docker
// The parent cgroup to pass to Docker
CgroupParent
string
CgroupParent
string
}
}
...
...
pkg/kubelet/dockertools/manager.go
View file @
3481db8a
...
@@ -473,7 +473,14 @@ func (dm *DockerManager) GetPodInfraContainer(pod kubecontainer.Pod) (kubecontai
...
@@ -473,7 +473,14 @@ func (dm *DockerManager) GetPodInfraContainer(pod kubecontainer.Pod) (kubecontai
return
kubecontainer
.
Container
{},
fmt
.
Errorf
(
"unable to find pod infra container for pod %v"
,
pod
.
ID
)
return
kubecontainer
.
Container
{},
fmt
.
Errorf
(
"unable to find pod infra container for pod %v"
,
pod
.
ID
)
}
}
func
(
dm
*
DockerManager
)
runContainer
(
pod
*
api
.
Pod
,
container
*
api
.
Container
,
opts
*
kubecontainer
.
RunContainerOptions
,
ref
*
api
.
ObjectReference
)
(
string
,
error
)
{
func
(
dm
*
DockerManager
)
runContainer
(
pod
*
api
.
Pod
,
container
*
api
.
Container
,
opts
*
kubecontainer
.
RunContainerOptions
,
ref
*
api
.
ObjectReference
,
netMode
string
,
ipcMode
string
)
(
string
,
error
)
{
dockerName
:=
KubeletContainerName
{
dockerName
:=
KubeletContainerName
{
PodFullName
:
kubecontainer
.
GetPodFullName
(
pod
),
PodFullName
:
kubecontainer
.
GetPodFullName
(
pod
),
PodUID
:
pod
.
UID
,
PodUID
:
pod
.
UID
,
...
@@ -545,8 +552,8 @@ func (dm *DockerManager) runContainer(pod *api.Pod, container *api.Container, op
...
@@ -545,8 +552,8 @@ func (dm *DockerManager) runContainer(pod *api.Pod, container *api.Container, op
hc
:=
&
docker
.
HostConfig
{
hc
:=
&
docker
.
HostConfig
{
PortBindings
:
portBindings
,
PortBindings
:
portBindings
,
Binds
:
opts
.
Binds
,
Binds
:
opts
.
Binds
,
NetworkMode
:
opts
.
N
etMode
,
NetworkMode
:
n
etMode
,
IpcMode
:
opts
.
I
pcMode
,
IpcMode
:
i
pcMode
,
}
}
if
len
(
opts
.
DNS
)
>
0
{
if
len
(
opts
.
DNS
)
>
0
{
hc
.
DNS
=
opts
.
DNS
hc
.
DNS
=
opts
.
DNS
...
@@ -1112,12 +1119,12 @@ func (dm *DockerManager) runContainerInPod(pod *api.Pod, container *api.Containe
...
@@ -1112,12 +1119,12 @@ func (dm *DockerManager) runContainerInPod(pod *api.Pod, container *api.Containe
glog
.
Errorf
(
"Couldn't make a ref to pod %v, container %v: '%v'"
,
pod
.
Name
,
container
.
Name
,
err
)
glog
.
Errorf
(
"Couldn't make a ref to pod %v, container %v: '%v'"
,
pod
.
Name
,
container
.
Name
,
err
)
}
}
opts
,
err
:=
dm
.
generator
.
GenerateRunContainerOptions
(
pod
,
container
,
netMode
,
ipcMode
)
opts
,
err
:=
dm
.
generator
.
GenerateRunContainerOptions
(
pod
,
container
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
id
,
err
:=
dm
.
runContainer
(
pod
,
container
,
opts
,
ref
)
id
,
err
:=
dm
.
runContainer
(
pod
,
container
,
opts
,
ref
,
netMode
,
ipcMode
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
...
...
pkg/kubelet/kubelet.go
View file @
3481db8a
...
@@ -705,13 +705,9 @@ func makeBinds(container *api.Container, podVolumes kubecontainer.VolumeMap) (bi
...
@@ -705,13 +705,9 @@ func makeBinds(container *api.Container, podVolumes kubecontainer.VolumeMap) (bi
// GenerateRunContainerOptions generates the RunContainerOptions, which can be used by
// GenerateRunContainerOptions generates the RunContainerOptions, which can be used by
// the container runtime to set parameters for launching a container.
// the container runtime to set parameters for launching a container.
func
(
kl
*
Kubelet
)
GenerateRunContainerOptions
(
pod
*
api
.
Pod
,
container
*
api
.
Container
,
netMode
,
ipcMode
string
)
(
*
kubecontainer
.
RunContainerOptions
,
error
)
{
func
(
kl
*
Kubelet
)
GenerateRunContainerOptions
(
pod
*
api
.
Pod
,
container
*
api
.
Container
)
(
*
kubecontainer
.
RunContainerOptions
,
error
)
{
var
err
error
var
err
error
opts
:=
&
kubecontainer
.
RunContainerOptions
{
opts
:=
&
kubecontainer
.
RunContainerOptions
{
CgroupParent
:
kl
.
cgroupRoot
}
NetMode
:
netMode
,
IpcMode
:
ipcMode
,
CgroupParent
:
kl
.
cgroupRoot
,
}
vol
,
ok
:=
kl
.
volumeManager
.
GetVolumes
(
pod
.
UID
)
vol
,
ok
:=
kl
.
volumeManager
.
GetVolumes
(
pod
.
UID
)
if
!
ok
{
if
!
ok
{
...
...
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