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
9a1e30f7
Commit
9a1e30f7
authored
Feb 17, 2017
by
Derek Carr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BestEffort QoS class has min cpu shares
parent
5fb6b91f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
container_manager_linux.go
pkg/kubelet/cm/container_manager_linux.go
+13
-1
No files found.
pkg/kubelet/cm/container_manager_linux.go
View file @
9a1e30f7
...
@@ -282,16 +282,28 @@ func InitQOS(cgroupDriver, rootContainer string, subsystems *CgroupSubsystems) (
...
@@ -282,16 +282,28 @@ func InitQOS(cgroupDriver, rootContainer string, subsystems *CgroupSubsystems) (
for
_
,
qosClass
:=
range
qosClasses
{
for
_
,
qosClass
:=
range
qosClasses
{
// get the container's absolute name
// get the container's absolute name
absoluteContainerName
:=
CgroupName
(
path
.
Join
(
rootContainer
,
string
(
qosClass
)))
absoluteContainerName
:=
CgroupName
(
path
.
Join
(
rootContainer
,
string
(
qosClass
)))
resourceParameters
:=
&
ResourceConfig
{}
// the BestEffort QoS class has a statically configured minShares value
if
qosClass
==
v1
.
PodQOSBestEffort
{
minShares
:=
int64
(
MinShares
)
resourceParameters
.
CpuShares
=
&
minShares
}
// containerConfig object stores the cgroup specifications
// containerConfig object stores the cgroup specifications
containerConfig
:=
&
CgroupConfig
{
containerConfig
:=
&
CgroupConfig
{
Name
:
absoluteContainerName
,
Name
:
absoluteContainerName
,
ResourceParameters
:
&
ResourceConfig
{}
,
ResourceParameters
:
resourceParameters
,
}
}
// check if it exists
// check if it exists
if
!
cm
.
Exists
(
absoluteContainerName
)
{
if
!
cm
.
Exists
(
absoluteContainerName
)
{
if
err
:=
cm
.
Create
(
containerConfig
);
err
!=
nil
{
if
err
:=
cm
.
Create
(
containerConfig
);
err
!=
nil
{
return
QOSContainersInfo
{},
fmt
.
Errorf
(
"failed to create top level %v QOS cgroup : %v"
,
qosClass
,
err
)
return
QOSContainersInfo
{},
fmt
.
Errorf
(
"failed to create top level %v QOS cgroup : %v"
,
qosClass
,
err
)
}
}
}
else
{
// to ensure we actually have the right state, we update the config on startup
if
err
:=
cm
.
Update
(
containerConfig
);
err
!=
nil
{
return
QOSContainersInfo
{},
fmt
.
Errorf
(
"failed to update top level %v QOS cgroup : %v"
,
qosClass
,
err
)
}
}
}
}
}
// Store the top level qos container names
// Store the top level qos container names
...
...
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