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
fb18b093
Commit
fb18b093
authored
Aug 19, 2015
by
Saad Ali
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12885 from dchen1107/docker
Leave process 1 at root cgroup
parents
0c99a918
8b3937c9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
container_manager_linux.go
pkg/kubelet/container_manager_linux.go
+16
-5
No files found.
pkg/kubelet/container_manager_linux.go
View file @
fb18b093
...
@@ -137,8 +137,6 @@ func newContainerManager(cadvisorInterface cadvisor.Interface, dockerDaemonConta
...
@@ -137,8 +137,6 @@ func newContainerManager(cadvisorInterface cadvisor.Interface, dockerDaemonConta
systemContainers
=
append
(
systemContainers
,
newSystemContainer
(
kubeletContainerName
))
systemContainers
=
append
(
systemContainers
,
newSystemContainer
(
kubeletContainerName
))
}
}
// TODO(vmarmol): Add Kube-proxy container.
return
&
containerManagerImpl
{
return
&
containerManagerImpl
{
systemContainers
:
systemContainers
,
systemContainers
:
systemContainers
,
},
nil
},
nil
...
@@ -250,8 +248,16 @@ func getContainer(pid int) (string, error) {
...
@@ -250,8 +248,16 @@ func getContainer(pid int) (string, error) {
return
cgroups
.
ParseCgroupFile
(
"cpu"
,
f
)
return
cgroups
.
ParseCgroupFile
(
"cpu"
,
f
)
}
}
// Ensures the system container is created and all non-kernel processes without
// Ensures the system container is created and all non-kernel threads and process 1
// a container are moved to it.
// without a container are moved to it.
//
// The reason of leaving kernel threads at root cgroup is that we don't want to tie the
// execution of these threads with to-be defined /system quota and create priority inversions.
//
// The reason of leaving process 1 at root cgroup is that libcontainer hardcoded on
// the base cgroup path based on process 1. Please see:
// https://github.com/kubernetes/kubernetes/issues/12789#issuecomment-132384126
// for detail explanation.
func
ensureSystemContainer
(
rootContainer
*
fs
.
Manager
,
manager
*
fs
.
Manager
)
error
{
func
ensureSystemContainer
(
rootContainer
*
fs
.
Manager
,
manager
*
fs
.
Manager
)
error
{
// Move non-kernel PIDs to the system container.
// Move non-kernel PIDs to the system container.
attemptsRemaining
:=
10
attemptsRemaining
:=
10
...
@@ -267,13 +273,18 @@ func ensureSystemContainer(rootContainer *fs.Manager, manager *fs.Manager) error
...
@@ -267,13 +273,18 @@ func ensureSystemContainer(rootContainer *fs.Manager, manager *fs.Manager) error
continue
continue
}
}
// Remove kernel pids
// Remove kernel pids
and process 1
pids
:=
make
([]
int
,
0
,
len
(
allPids
))
pids
:=
make
([]
int
,
0
,
len
(
allPids
))
for
_
,
pid
:=
range
allPids
{
for
_
,
pid
:=
range
allPids
{
if
isKernelPid
(
pid
)
{
if
isKernelPid
(
pid
)
{
continue
continue
}
}
// TODO(dawnchen): Remove this once the hard dependency on process 1 is removed
// on systemd node.
if
pid
==
1
{
continue
}
pids
=
append
(
pids
,
pid
)
pids
=
append
(
pids
,
pid
)
}
}
glog
.
Infof
(
"Found %d PIDs in root, %d of them are kernel related"
,
len
(
allPids
),
len
(
allPids
)
-
len
(
pids
))
glog
.
Infof
(
"Found %d PIDs in root, %d of them are kernel related"
,
len
(
allPids
),
len
(
allPids
)
-
len
(
pids
))
...
...
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