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
e994ce1f
Commit
e994ce1f
authored
Feb 02, 2018
by
Seth Jennings
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodelifecycle: set OutOfDisk unknown on node timeout
parent
49bf4421
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
node_lifecycle_controller.go
pkg/controller/nodelifecycle/node_lifecycle_controller.go
+3
-1
node_lifecycle_controller_test.go
...ontroller/nodelifecycle/node_lifecycle_controller_test.go
+30
-0
No files found.
pkg/controller/nodelifecycle/node_lifecycle_controller.go
View file @
e994ce1f
...
@@ -52,9 +52,10 @@ import (
...
@@ -52,9 +52,10 @@ import (
utilversion
"k8s.io/kubernetes/pkg/util/version"
utilversion
"k8s.io/kubernetes/pkg/util/version"
"fmt"
"fmt"
"github.com/golang/glog"
"sync"
"sync"
"time"
"time"
"github.com/golang/glog"
)
)
func
init
()
{
func
init
()
{
...
@@ -813,6 +814,7 @@ func (nc *Controller) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1.Node
...
@@ -813,6 +814,7 @@ func (nc *Controller) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1.Node
// remaining node conditions should also be set to Unknown
// remaining node conditions should also be set to Unknown
remainingNodeConditionTypes
:=
[]
v1
.
NodeConditionType
{
remainingNodeConditionTypes
:=
[]
v1
.
NodeConditionType
{
v1
.
NodeOutOfDisk
,
v1
.
NodeMemoryPressure
,
v1
.
NodeMemoryPressure
,
v1
.
NodeDiskPressure
,
v1
.
NodeDiskPressure
,
// We don't change 'NodeNetworkUnavailable' condition, as it's managed on a control plane level.
// We don't change 'NodeNetworkUnavailable' condition, as it's managed on a control plane level.
...
...
pkg/controller/nodelifecycle/node_lifecycle_controller_test.go
View file @
e994ce1f
...
@@ -1466,6 +1466,14 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) {
...
@@ -1466,6 +1466,14 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) {
LastTransitionTime
:
fakeNow
,
LastTransitionTime
:
fakeNow
,
},
},
{
{
Type
:
v1
.
NodeOutOfDisk
,
Status
:
v1
.
ConditionUnknown
,
Reason
:
"NodeStatusNeverUpdated"
,
Message
:
"Kubelet never posted node status."
,
LastHeartbeatTime
:
metav1
.
Date
(
2012
,
1
,
1
,
0
,
0
,
0
,
0
,
time
.
UTC
),
LastTransitionTime
:
fakeNow
,
},
{
Type
:
v1
.
NodeMemoryPressure
,
Type
:
v1
.
NodeMemoryPressure
,
Status
:
v1
.
ConditionUnknown
,
Status
:
v1
.
ConditionUnknown
,
Reason
:
"NodeStatusNeverUpdated"
,
Reason
:
"NodeStatusNeverUpdated"
,
...
@@ -1522,6 +1530,13 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) {
...
@@ -1522,6 +1530,13 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) {
LastHeartbeatTime
:
metav1
.
Date
(
2015
,
1
,
1
,
12
,
0
,
0
,
0
,
time
.
UTC
),
LastHeartbeatTime
:
metav1
.
Date
(
2015
,
1
,
1
,
12
,
0
,
0
,
0
,
time
.
UTC
),
LastTransitionTime
:
metav1
.
Date
(
2015
,
1
,
1
,
12
,
0
,
0
,
0
,
time
.
UTC
),
LastTransitionTime
:
metav1
.
Date
(
2015
,
1
,
1
,
12
,
0
,
0
,
0
,
time
.
UTC
),
},
},
{
Type
:
v1
.
NodeOutOfDisk
,
Status
:
v1
.
ConditionFalse
,
// Node status hasn't been updated for 1hr.
LastHeartbeatTime
:
metav1
.
Date
(
2015
,
1
,
1
,
12
,
0
,
0
,
0
,
time
.
UTC
),
LastTransitionTime
:
metav1
.
Date
(
2015
,
1
,
1
,
12
,
0
,
0
,
0
,
time
.
UTC
),
},
},
},
Capacity
:
v1
.
ResourceList
{
Capacity
:
v1
.
ResourceList
{
v1
.
ResourceName
(
v1
.
ResourceCPU
)
:
resource
.
MustParse
(
"10"
),
v1
.
ResourceName
(
v1
.
ResourceCPU
)
:
resource
.
MustParse
(
"10"
),
...
@@ -1546,6 +1561,13 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) {
...
@@ -1546,6 +1561,13 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) {
LastHeartbeatTime
:
metav1
.
Date
(
2015
,
1
,
1
,
12
,
0
,
0
,
0
,
time
.
UTC
),
LastHeartbeatTime
:
metav1
.
Date
(
2015
,
1
,
1
,
12
,
0
,
0
,
0
,
time
.
UTC
),
LastTransitionTime
:
metav1
.
Date
(
2015
,
1
,
1
,
12
,
0
,
0
,
0
,
time
.
UTC
),
LastTransitionTime
:
metav1
.
Date
(
2015
,
1
,
1
,
12
,
0
,
0
,
0
,
time
.
UTC
),
},
},
{
Type
:
v1
.
NodeOutOfDisk
,
Status
:
v1
.
ConditionFalse
,
// Node status hasn't been updated for 1hr.
LastHeartbeatTime
:
metav1
.
Date
(
2015
,
1
,
1
,
12
,
0
,
0
,
0
,
time
.
UTC
),
LastTransitionTime
:
metav1
.
Date
(
2015
,
1
,
1
,
12
,
0
,
0
,
0
,
time
.
UTC
),
},
},
},
Capacity
:
v1
.
ResourceList
{
Capacity
:
v1
.
ResourceList
{
v1
.
ResourceName
(
v1
.
ResourceCPU
)
:
resource
.
MustParse
(
"10"
),
v1
.
ResourceName
(
v1
.
ResourceCPU
)
:
resource
.
MustParse
(
"10"
),
...
@@ -1569,6 +1591,14 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) {
...
@@ -1569,6 +1591,14 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) {
LastTransitionTime
:
metav1
.
Time
{
Time
:
metav1
.
Date
(
2015
,
1
,
1
,
12
,
0
,
0
,
0
,
time
.
UTC
)
.
Add
(
time
.
Hour
)},
LastTransitionTime
:
metav1
.
Time
{
Time
:
metav1
.
Date
(
2015
,
1
,
1
,
12
,
0
,
0
,
0
,
time
.
UTC
)
.
Add
(
time
.
Hour
)},
},
},
{
{
Type
:
v1
.
NodeOutOfDisk
,
Status
:
v1
.
ConditionUnknown
,
Reason
:
"NodeStatusUnknown"
,
Message
:
"Kubelet stopped posting node status."
,
LastHeartbeatTime
:
metav1
.
Date
(
2015
,
1
,
1
,
12
,
0
,
0
,
0
,
time
.
UTC
),
LastTransitionTime
:
metav1
.
Time
{
Time
:
metav1
.
Date
(
2015
,
1
,
1
,
12
,
0
,
0
,
0
,
time
.
UTC
)
.
Add
(
time
.
Hour
)},
},
{
Type
:
v1
.
NodeMemoryPressure
,
Type
:
v1
.
NodeMemoryPressure
,
Status
:
v1
.
ConditionUnknown
,
Status
:
v1
.
ConditionUnknown
,
Reason
:
"NodeStatusNeverUpdated"
,
Reason
:
"NodeStatusNeverUpdated"
,
...
...
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