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
7e28a2cf
Commit
7e28a2cf
authored
Jul 15, 2017
by
Klaus Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added comments on not set node network/inode condition to unknown.
parent
f736f312
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
nodecontroller.go
pkg/controller/node/nodecontroller.go
+13
-5
No files found.
pkg/controller/node/nodecontroller.go
View file @
7e28a2cf
...
...
@@ -833,8 +833,8 @@ func (nc *NodeController) setLimiterInZone(zone string, zoneSize int, state zone
}
}
//
For a given node checks its conditions and tries to update it. Returns grace period to which given node
// is entitled, state of current and last observed Ready Condition, and an error if it occurred.
//
tryUpdateNodeStatus checks a given node's conditions and tries to update it. Returns grace period to
//
which given node
is entitled, state of current and last observed Ready Condition, and an error if it occurred.
func
(
nc
*
NodeController
)
tryUpdateNodeStatus
(
node
*
v1
.
Node
)
(
time
.
Duration
,
v1
.
NodeCondition
,
*
v1
.
NodeCondition
,
error
)
{
var
err
error
var
gracePeriod
time
.
Duration
...
...
@@ -910,7 +910,6 @@ func (nc *NodeController) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1.
// otherwise we leave it as it is.
if
savedCondition
.
LastTransitionTime
!=
observedCondition
.
LastTransitionTime
{
glog
.
V
(
3
)
.
Infof
(
"ReadyCondition for Node %s transitioned from %v to %v"
,
node
.
Name
,
savedCondition
.
Status
,
observedCondition
)
transitionTime
=
nc
.
now
()
}
else
{
transitionTime
=
savedNodeStatus
.
readyTransitionTimestamp
...
...
@@ -955,7 +954,16 @@ func (nc *NodeController) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1.
}
// remaining node conditions should also be set to Unknown
remainingNodeConditionTypes
:=
[]
v1
.
NodeConditionType
{
v1
.
NodeOutOfDisk
,
v1
.
NodeMemoryPressure
,
v1
.
NodeDiskPressure
}
remainingNodeConditionTypes
:=
[]
v1
.
NodeConditionType
{
v1
.
NodeOutOfDisk
,
v1
.
NodeMemoryPressure
,
v1
.
NodeDiskPressure
,
// We don't change 'NodeInodePressure' condition, as it'll be removed in future.
// v1.NodeInodePressure,
// We don't change 'NodeNetworkUnavailable' condition, as it's managed on a control plane level.
// v1.NodeNetworkUnavailable,
}
nowTimestamp
:=
nc
.
now
()
for
_
,
nodeConditionType
:=
range
remainingNodeConditionTypes
{
_
,
currentCondition
:=
nodeutil
.
GetNodeCondition
(
&
node
.
Status
,
nodeConditionType
)
...
...
@@ -1091,7 +1099,7 @@ func (nc *NodeController) ReducedQPSFunc(nodeNum int) float32 {
return
0
}
//
This function is expected to get
a slice of NodeReadyConditions for all Nodes in a given zone.
//
ComputeZoneState returns
a slice of NodeReadyConditions for all Nodes in a given zone.
// The zone is considered:
// - fullyDisrupted if there're no Ready Nodes,
// - partiallyDisrupted if at least than nc.unhealthyZoneThreshold percent of Nodes are not Ready,
...
...
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