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
49201f69
Commit
49201f69
authored
Aug 02, 2016
by
Buddha Prakash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Libcontainer's Cgroup Config: AllowAllDevices to be Nil
parent
216d707f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
container_manager_linux.go
pkg/kubelet/cm/container_manager_linux.go
+6
-4
resource_container_linux.go
pkg/util/resourcecontainer/resource_container_linux.go
+2
-1
No files found.
pkg/kubelet/cm/container_manager_linux.go
View file @
49201f69
...
@@ -188,12 +188,13 @@ func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.I
...
@@ -188,12 +188,13 @@ func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.I
// Create a cgroup container manager.
// Create a cgroup container manager.
func
createManager
(
containerName
string
)
*
fs
.
Manager
{
func
createManager
(
containerName
string
)
*
fs
.
Manager
{
allowAllDevices
:=
true
return
&
fs
.
Manager
{
return
&
fs
.
Manager
{
Cgroups
:
&
configs
.
Cgroup
{
Cgroups
:
&
configs
.
Cgroup
{
Parent
:
"/"
,
Parent
:
"/"
,
Name
:
containerName
,
Name
:
containerName
,
Resources
:
&
configs
.
Resources
{
Resources
:
&
configs
.
Resources
{
AllowAllDevices
:
true
,
AllowAllDevices
:
&
allowAllDevices
,
},
},
},
},
}
}
...
@@ -319,7 +320,7 @@ func (cm *containerManagerImpl) setupNode() error {
...
@@ -319,7 +320,7 @@ func (cm *containerManagerImpl) setupNode() error {
}
}
glog
.
V
(
2
)
.
Infof
(
"Configure resource-only container %s with memory limit: %d"
,
cm
.
RuntimeCgroupsName
,
memoryLimit
)
glog
.
V
(
2
)
.
Infof
(
"Configure resource-only container %s with memory limit: %d"
,
cm
.
RuntimeCgroupsName
,
memoryLimit
)
allowAllDevices
:=
true
dockerContainer
:=
&
fs
.
Manager
{
dockerContainer
:=
&
fs
.
Manager
{
Cgroups
:
&
configs
.
Cgroup
{
Cgroups
:
&
configs
.
Cgroup
{
Parent
:
"/"
,
Parent
:
"/"
,
...
@@ -327,7 +328,7 @@ func (cm *containerManagerImpl) setupNode() error {
...
@@ -327,7 +328,7 @@ func (cm *containerManagerImpl) setupNode() error {
Resources
:
&
configs
.
Resources
{
Resources
:
&
configs
.
Resources
{
Memory
:
memoryLimit
,
Memory
:
memoryLimit
,
MemorySwap
:
-
1
,
MemorySwap
:
-
1
,
AllowAllDevices
:
true
,
AllowAllDevices
:
&
allowAllDevices
,
},
},
},
},
}
}
...
@@ -370,12 +371,13 @@ func (cm *containerManagerImpl) setupNode() error {
...
@@ -370,12 +371,13 @@ func (cm *containerManagerImpl) setupNode() error {
if
cm
.
KubeletCgroupsName
!=
""
{
if
cm
.
KubeletCgroupsName
!=
""
{
cont
:=
newSystemCgroups
(
cm
.
KubeletCgroupsName
)
cont
:=
newSystemCgroups
(
cm
.
KubeletCgroupsName
)
allowAllDevices
:=
true
manager
:=
fs
.
Manager
{
manager
:=
fs
.
Manager
{
Cgroups
:
&
configs
.
Cgroup
{
Cgroups
:
&
configs
.
Cgroup
{
Parent
:
"/"
,
Parent
:
"/"
,
Name
:
cm
.
KubeletCgroupsName
,
Name
:
cm
.
KubeletCgroupsName
,
Resources
:
&
configs
.
Resources
{
Resources
:
&
configs
.
Resources
{
AllowAllDevices
:
true
,
AllowAllDevices
:
&
allowAllDevices
,
},
},
},
},
}
}
...
...
pkg/util/resourcecontainer/resource_container_linux.go
View file @
49201f69
...
@@ -30,12 +30,13 @@ import (
...
@@ -30,12 +30,13 @@ import (
//
//
// containerName must be an absolute container name.
// containerName must be an absolute container name.
func
RunInResourceContainer
(
containerName
string
)
error
{
func
RunInResourceContainer
(
containerName
string
)
error
{
allowAllDevices
:=
true
manager
:=
fs
.
Manager
{
manager
:=
fs
.
Manager
{
Cgroups
:
&
configs
.
Cgroup
{
Cgroups
:
&
configs
.
Cgroup
{
Parent
:
"/"
,
Parent
:
"/"
,
Name
:
containerName
,
Name
:
containerName
,
Resources
:
&
configs
.
Resources
{
Resources
:
&
configs
.
Resources
{
AllowAllDevices
:
true
,
AllowAllDevices
:
&
allowAllDevices
,
},
},
},
},
}
}
...
...
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