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
f9ee66f4
Commit
f9ee66f4
authored
Jan 18, 2024
by
Vitor Savian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed how lastHeartBeatTime works in the etcd condition
Signed-off-by:
Vitor Savian
<
vitor.savian@suse.com
>
parent
358c4d6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
etcd.go
pkg/etcd/etcd.go
+11
-1
No files found.
pkg/etcd/etcd.go
View file @
f9ee66f4
...
@@ -68,6 +68,7 @@ const (
...
@@ -68,6 +68,7 @@ const (
// other defaults from k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go
// other defaults from k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go
defaultKeepAliveTime
=
30
*
time
.
Second
defaultKeepAliveTime
=
30
*
time
.
Second
defaultKeepAliveTimeout
=
10
*
time
.
Second
defaultKeepAliveTimeout
=
10
*
time
.
Second
heartbeatInterval
=
5
*
time
.
Minute
maxBackupRetention
=
5
maxBackupRetention
=
5
...
@@ -1251,8 +1252,17 @@ func (e *ETCD) setEtcdStatusCondition(node *v1.Node, client kubernetes.Interface
...
@@ -1251,8 +1252,17 @@ func (e *ETCD) setEtcdStatusCondition(node *v1.Node, client kubernetes.Interface
}
}
if
find
,
condition
:=
nodeUtil
.
GetNodeCondition
(
&
node
.
Status
,
etcdStatusType
);
find
>=
0
{
if
find
,
condition
:=
nodeUtil
.
GetNodeCondition
(
&
node
.
Status
,
etcdStatusType
);
find
>=
0
{
if
condition
.
Status
==
newCondition
.
Status
&&
memberStatus
!=
StatusUnjoined
{
// if the condition is not changing, we only want to update the last heartbeat time
if
condition
.
Status
==
newCondition
.
Status
&&
condition
.
Reason
==
newCondition
.
Reason
&&
condition
.
Message
==
newCondition
.
Message
{
logrus
.
Debugf
(
"Node %s is not changing etcd status condition"
,
memberName
)
logrus
.
Debugf
(
"Node %s is not changing etcd status condition"
,
memberName
)
// If the condition status is not changing, we only want to update the last heartbeat time if the
// LastHeartbeatTime is older than the heartbeatTimeout.
if
metav1
.
Now
()
.
Sub
(
condition
.
LastHeartbeatTime
.
Time
)
<
heartbeatInterval
{
return
nil
}
condition
.
LastHeartbeatTime
=
metav1
.
Now
()
condition
.
LastHeartbeatTime
=
metav1
.
Now
()
return
nodeHelper
.
SetNodeCondition
(
client
,
types
.
NodeName
(
node
.
Name
),
*
condition
)
return
nodeHelper
.
SetNodeCondition
(
client
,
types
.
NodeName
(
node
.
Name
),
*
condition
)
}
}
...
...
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