mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Added comments on not set node network/inode condition to unknown.
This commit is contained in:
parent
f736f3121f
commit
7e28a2cfd1
@ -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
|
// tryUpdateNodeStatus checks a given node's conditions and tries to update it. Returns grace period to
|
||||||
// is entitled, state of current and last observed Ready Condition, and an error if it occurred.
|
// 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) {
|
func (nc *NodeController) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1.NodeCondition, *v1.NodeCondition, error) {
|
||||||
var err error
|
var err error
|
||||||
var gracePeriod time.Duration
|
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.
|
// otherwise we leave it as it is.
|
||||||
if savedCondition.LastTransitionTime != observedCondition.LastTransitionTime {
|
if savedCondition.LastTransitionTime != observedCondition.LastTransitionTime {
|
||||||
glog.V(3).Infof("ReadyCondition for Node %s transitioned from %v to %v", node.Name, savedCondition.Status, observedCondition)
|
glog.V(3).Infof("ReadyCondition for Node %s transitioned from %v to %v", node.Name, savedCondition.Status, observedCondition)
|
||||||
|
|
||||||
transitionTime = nc.now()
|
transitionTime = nc.now()
|
||||||
} else {
|
} else {
|
||||||
transitionTime = savedNodeStatus.readyTransitionTimestamp
|
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
|
// 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()
|
nowTimestamp := nc.now()
|
||||||
for _, nodeConditionType := range remainingNodeConditionTypes {
|
for _, nodeConditionType := range remainingNodeConditionTypes {
|
||||||
_, currentCondition := nodeutil.GetNodeCondition(&node.Status, nodeConditionType)
|
_, currentCondition := nodeutil.GetNodeCondition(&node.Status, nodeConditionType)
|
||||||
@ -1091,7 +1099,7 @@ func (nc *NodeController) ReducedQPSFunc(nodeNum int) float32 {
|
|||||||
return 0
|
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:
|
// The zone is considered:
|
||||||
// - fullyDisrupted if there're no Ready Nodes,
|
// - fullyDisrupted if there're no Ready Nodes,
|
||||||
// - partiallyDisrupted if at least than nc.unhealthyZoneThreshold percent of Nodes are not Ready,
|
// - partiallyDisrupted if at least than nc.unhealthyZoneThreshold percent of Nodes are not Ready,
|
||||||
|
Loading…
Reference in New Issue
Block a user