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
48d822ea
Commit
48d822ea
authored
Mar 03, 2017
by
Derek Carr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroup names created by kubelet should be lowercased
parent
61e7d1eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
12 deletions
+23
-12
qos_container_manager_linux.go
pkg/kubelet/cm/qos_container_manager_linux.go
+10
-5
pods_container_manager_test.go
test/e2e_node/pods_container_manager_test.go
+13
-7
No files found.
pkg/kubelet/cm/qos_container_manager_linux.go
View file @
48d822ea
...
...
@@ -19,12 +19,14 @@ package cm
import
(
"fmt"
"path"
"strings"
"sync"
"time"
"github.com/golang/glog"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/kubelet/qos"
)
...
...
@@ -81,12 +83,15 @@ func (m *qosContainerManagerImpl) Start(getNodeAllocatable func() v1.ResourceLis
// Top level for Qos containers are created only for Burstable
// and Best Effort classes
qosClasses
:=
[
2
]
v1
.
PodQOSClass
{
v1
.
PodQOSBurstable
,
v1
.
PodQOSBestEffort
}
qosClasses
:=
map
[
v1
.
PodQOSClass
]
string
{
v1
.
PodQOSBurstable
:
path
.
Join
(
rootContainer
,
strings
.
ToLower
(
string
(
v1
.
PodQOSBurstable
))),
v1
.
PodQOSBestEffort
:
path
.
Join
(
rootContainer
,
strings
.
ToLower
(
string
(
v1
.
PodQOSBestEffort
))),
}
// Create containers for both qos classes
for
_
,
qosClass
:=
range
qosClasses
{
for
qosClass
,
containerName
:=
range
qosClasses
{
// get the container's absolute name
absoluteContainerName
:=
CgroupName
(
path
.
Join
(
rootContainer
,
string
(
qosClass
))
)
absoluteContainerName
:=
CgroupName
(
containerName
)
resourceParameters
:=
&
ResourceConfig
{}
// the BestEffort QoS class has a statically configured minShares value
...
...
@@ -114,8 +119,8 @@ func (m *qosContainerManagerImpl) Start(getNodeAllocatable func() v1.ResourceLis
// Store the top level qos container names
m
.
qosContainersInfo
=
QOSContainersInfo
{
Guaranteed
:
rootContainer
,
Burstable
:
path
.
Join
(
rootContainer
,
string
(
v1
.
PodQOSBurstable
))
,
BestEffort
:
path
.
Join
(
rootContainer
,
string
(
v1
.
PodQOSBestEffort
))
,
Burstable
:
qosClasses
[
v1
.
PodQOSBurstable
]
,
BestEffort
:
qosClasses
[
v1
.
PodQOSBestEffort
]
,
}
m
.
getNodeAllocatable
=
getNodeAllocatable
m
.
activePods
=
activePods
...
...
test/e2e_node/pods_container_manager_test.go
View file @
48d822ea
...
...
@@ -52,8 +52,14 @@ func getResourceRequirements(requests, limits v1.ResourceList) v1.ResourceRequir
return
res
}
// Kubelet internal cgroup name for node allocatable cgroup.
const
defaultNodeAllocatableCgroup
=
"kubepods"
const
(
// Kubelet internal cgroup name for node allocatable cgroup.
defaultNodeAllocatableCgroup
=
"kubepods"
// Kubelet internal cgroup name for burstable tier
burstableCgroup
=
"burstable"
// Kubelet internal cgroup name for burstable tier
bestEffortCgroup
=
"burstable"
)
// makePodToVerifyCgroups returns a pod that verifies the existence of the specified cgroups.
func
makePodToVerifyCgroups
(
cgroupNames
[]
cm
.
CgroupName
)
*
v1
.
Pod
{
...
...
@@ -154,7 +160,7 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() {
if
!
framework
.
TestContext
.
KubeletConfig
.
CgroupsPerQOS
{
return
}
cgroupsToVerify
:=
[]
cm
.
CgroupName
{
cm
.
CgroupName
(
v1
.
PodQOSBurstable
),
cm
.
CgroupName
(
v1
.
PodQOSBestEffort
)}
cgroupsToVerify
:=
[]
cm
.
CgroupName
{
cm
.
CgroupName
(
burstableCgroup
),
cm
.
CgroupName
(
bestEffortCgroup
)}
pod
:=
makePodToVerifyCgroups
(
cgroupsToVerify
)
f
.
PodClient
()
.
Create
(
pod
)
err
:=
framework
.
WaitForPodSuccessInNamespace
(
f
.
ClientSet
,
pod
.
Name
,
f
.
Namespace
.
Name
)
...
...
@@ -236,7 +242,7 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() {
podUID
=
string
(
bestEffortPod
.
UID
)
})
By
(
"Checking if the pod cgroup was created"
,
func
()
{
cgroupsToVerify
:=
[]
cm
.
CgroupName
{
cm
.
CgroupName
(
"
BestE
ffort/pod"
+
podUID
)}
cgroupsToVerify
:=
[]
cm
.
CgroupName
{
cm
.
CgroupName
(
"
beste
ffort/pod"
+
podUID
)}
pod
:=
makePodToVerifyCgroups
(
cgroupsToVerify
)
f
.
PodClient
()
.
Create
(
pod
)
err
:=
framework
.
WaitForPodSuccessInNamespace
(
f
.
ClientSet
,
pod
.
Name
,
f
.
Namespace
.
Name
)
...
...
@@ -245,7 +251,7 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() {
By
(
"Checking if the pod cgroup was deleted"
,
func
()
{
gp
:=
int64
(
1
)
Expect
(
f
.
PodClient
()
.
Delete
(
bestEffortPod
.
Name
,
&
metav1
.
DeleteOptions
{
GracePeriodSeconds
:
&
gp
}))
.
NotTo
(
HaveOccurred
())
pod
:=
makePodToVerifyCgroupRemoved
(
cm
.
CgroupName
(
"
BestE
ffort/pod"
+
podUID
))
pod
:=
makePodToVerifyCgroupRemoved
(
cm
.
CgroupName
(
"
beste
ffort/pod"
+
podUID
))
f
.
PodClient
()
.
Create
(
pod
)
err
:=
framework
.
WaitForPodSuccessInNamespace
(
f
.
ClientSet
,
pod
.
Name
,
f
.
Namespace
.
Name
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
...
...
@@ -280,7 +286,7 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() {
podUID
=
string
(
burstablePod
.
UID
)
})
By
(
"Checking if the pod cgroup was created"
,
func
()
{
cgroupsToVerify
:=
[]
cm
.
CgroupName
{
cm
.
CgroupName
(
"
B
urstable/pod"
+
podUID
)}
cgroupsToVerify
:=
[]
cm
.
CgroupName
{
cm
.
CgroupName
(
"
b
urstable/pod"
+
podUID
)}
pod
:=
makePodToVerifyCgroups
(
cgroupsToVerify
)
f
.
PodClient
()
.
Create
(
pod
)
err
:=
framework
.
WaitForPodSuccessInNamespace
(
f
.
ClientSet
,
pod
.
Name
,
f
.
Namespace
.
Name
)
...
...
@@ -289,7 +295,7 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() {
By
(
"Checking if the pod cgroup was deleted"
,
func
()
{
gp
:=
int64
(
1
)
Expect
(
f
.
PodClient
()
.
Delete
(
burstablePod
.
Name
,
&
metav1
.
DeleteOptions
{
GracePeriodSeconds
:
&
gp
}))
.
NotTo
(
HaveOccurred
())
pod
:=
makePodToVerifyCgroupRemoved
(
cm
.
CgroupName
(
"
B
urstable/pod"
+
podUID
))
pod
:=
makePodToVerifyCgroupRemoved
(
cm
.
CgroupName
(
"
b
urstable/pod"
+
podUID
))
f
.
PodClient
()
.
Create
(
pod
)
err
:=
framework
.
WaitForPodSuccessInNamespace
(
f
.
ClientSet
,
pod
.
Name
,
f
.
Namespace
.
Name
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
...
...
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