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
d8aa0ca8
Commit
d8aa0ca8
authored
Sep 19, 2017
by
wackxu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the bad code comment and make the format unify
parent
00c1ec52
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
container_manager.go
pkg/kubelet/cm/container_manager.go
+5
-5
node_container_manager.go
pkg/kubelet/cm/node_container_manager.go
+3
-3
helpers.go
pkg/kubelet/eviction/helpers.go
+0
-0
types.go
pkg/kubelet/eviction/types.go
+1
-1
No files found.
pkg/kubelet/cm/container_manager.go
View file @
d8aa0ca8
...
@@ -42,14 +42,14 @@ type ContainerManager interface {
...
@@ -42,14 +42,14 @@ type ContainerManager interface {
// - Creates the system container where all non-containerized processes run.
// - Creates the system container where all non-containerized processes run.
Start
(
*
v1
.
Node
,
ActivePodsFunc
,
status
.
PodStatusProvider
,
internalapi
.
RuntimeService
)
error
Start
(
*
v1
.
Node
,
ActivePodsFunc
,
status
.
PodStatusProvider
,
internalapi
.
RuntimeService
)
error
//
R
eturns resources allocated to system cgroups in the machine.
//
SystemCgroupsLimit r
eturns resources allocated to system cgroups in the machine.
// These cgroups include the system and Kubernetes services.
// These cgroups include the system and Kubernetes services.
SystemCgroupsLimit
()
v1
.
ResourceList
SystemCgroupsLimit
()
v1
.
ResourceList
//
R
eturns a NodeConfig that is being used by the container manager.
//
GetNodeConfig r
eturns a NodeConfig that is being used by the container manager.
GetNodeConfig
()
NodeConfig
GetNodeConfig
()
NodeConfig
//
R
eturns internal Status.
//
Status r
eturns internal Status.
Status
()
Status
Status
()
Status
// NewPodContainerManager is a factory method which returns a podContainerManager object
// NewPodContainerManager is a factory method which returns a podContainerManager object
...
@@ -62,7 +62,7 @@ type ContainerManager interface {
...
@@ -62,7 +62,7 @@ type ContainerManager interface {
// GetQOSContainersInfo returns the names of top level QoS containers
// GetQOSContainersInfo returns the names of top level QoS containers
GetQOSContainersInfo
()
QOSContainersInfo
GetQOSContainersInfo
()
QOSContainersInfo
// GetNodeAllocatable returns the amount of compute resources that have to be reserved from scheduling.
// GetNodeAllocatable
Reservation
returns the amount of compute resources that have to be reserved from scheduling.
GetNodeAllocatableReservation
()
v1
.
ResourceList
GetNodeAllocatableReservation
()
v1
.
ResourceList
// GetCapacity returns the amount of compute resources tracked by container manager available on the node.
// GetCapacity returns the amount of compute resources tracked by container manager available on the node.
...
@@ -72,7 +72,7 @@ type ContainerManager interface {
...
@@ -72,7 +72,7 @@ type ContainerManager interface {
// level QoS containers have their desired state in a thread-safe way
// level QoS containers have their desired state in a thread-safe way
UpdateQOSCgroups
()
error
UpdateQOSCgroups
()
error
//
R
eturns RunContainerOptions with devices, mounts, and env fields populated for
//
GetResources r
eturns RunContainerOptions with devices, mounts, and env fields populated for
// extended resources required by container.
// extended resources required by container.
GetResources
(
pod
*
v1
.
Pod
,
container
*
v1
.
Container
,
activePods
[]
*
v1
.
Pod
)
(
*
kubecontainer
.
RunContainerOptions
,
error
)
GetResources
(
pod
*
v1
.
Pod
,
container
*
v1
.
Container
,
activePods
[]
*
v1
.
Pod
)
(
*
kubecontainer
.
RunContainerOptions
,
error
)
...
...
pkg/kubelet/cm/node_container_manager.go
View file @
d8aa0ca8
...
@@ -55,7 +55,7 @@ func (cm *containerManagerImpl) createNodeAllocatableCgroups() error {
...
@@ -55,7 +55,7 @@ func (cm *containerManagerImpl) createNodeAllocatableCgroups() error {
return
nil
return
nil
}
}
//
E
nforce Node Allocatable Cgroup settings.
//
enforceNodeAllocatableCgroups e
nforce Node Allocatable Cgroup settings.
func
(
cm
*
containerManagerImpl
)
enforceNodeAllocatableCgroups
()
error
{
func
(
cm
*
containerManagerImpl
)
enforceNodeAllocatableCgroups
()
error
{
nc
:=
cm
.
NodeConfig
.
NodeAllocatableConfig
nc
:=
cm
.
NodeConfig
.
NodeAllocatableConfig
...
@@ -139,7 +139,7 @@ func enforceExistingCgroup(cgroupManager CgroupManager, cName string, rl v1.Reso
...
@@ -139,7 +139,7 @@ func enforceExistingCgroup(cgroupManager CgroupManager, cName string, rl v1.Reso
return
nil
return
nil
}
}
//
R
eturns a ResourceConfig object that can be used to create or update cgroups via CgroupManager interface.
//
getCgroupConfig r
eturns a ResourceConfig object that can be used to create or update cgroups via CgroupManager interface.
func
getCgroupConfig
(
rl
v1
.
ResourceList
)
*
ResourceConfig
{
func
getCgroupConfig
(
rl
v1
.
ResourceList
)
*
ResourceConfig
{
// TODO(vishh): Set CPU Quota if necessary.
// TODO(vishh): Set CPU Quota if necessary.
if
rl
==
nil
{
if
rl
==
nil
{
...
@@ -186,7 +186,7 @@ func (cm *containerManagerImpl) getNodeAllocatableAbsolute() v1.ResourceList {
...
@@ -186,7 +186,7 @@ func (cm *containerManagerImpl) getNodeAllocatableAbsolute() v1.ResourceList {
}
}
// GetNodeAllocatable returns amount of compute or storage resource that have to be reserved on this node from scheduling.
// GetNodeAllocatable
Reservation
returns amount of compute or storage resource that have to be reserved on this node from scheduling.
func
(
cm
*
containerManagerImpl
)
GetNodeAllocatableReservation
()
v1
.
ResourceList
{
func
(
cm
*
containerManagerImpl
)
GetNodeAllocatableReservation
()
v1
.
ResourceList
{
evictionReservation
:=
hardEvictionReservation
(
cm
.
HardEvictionThresholds
,
cm
.
capacity
)
evictionReservation
:=
hardEvictionReservation
(
cm
.
HardEvictionThresholds
,
cm
.
capacity
)
result
:=
make
(
v1
.
ResourceList
)
result
:=
make
(
v1
.
ResourceList
)
...
...
pkg/kubelet/eviction/helpers.go
View file @
d8aa0ca8
pkg/kubelet/eviction/types.go
View file @
d8aa0ca8
...
@@ -72,7 +72,7 @@ type DiskInfoProvider interface {
...
@@ -72,7 +72,7 @@ type DiskInfoProvider interface {
type
CapacityProvider
interface
{
type
CapacityProvider
interface
{
// GetCapacity returns the amount of compute resources tracked by container manager available on the node.
// GetCapacity returns the amount of compute resources tracked by container manager available on the node.
GetCapacity
()
v1
.
ResourceList
GetCapacity
()
v1
.
ResourceList
// GetNodeAllocatable returns the amount of compute resources that have to be reserved from scheduling.
// GetNodeAllocatable
Reservation
returns the amount of compute resources that have to be reserved from scheduling.
GetNodeAllocatableReservation
()
v1
.
ResourceList
GetNodeAllocatableReservation
()
v1
.
ResourceList
}
}
...
...
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