-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tunnel heartbeat for fast datapath failover #847
Conversation
gateway pod 的 一些高可用 能力,可以在相关文档中 体现下: 故障后,vip 是怎么处理的, 恢复后,vip 是怎么处理的 |
e14e474
to
029ac58
Compare
e111148
to
646b209
Compare
Codecov Report
@@ Coverage Diff @@
## main #847 +/- ##
==========================================
- Coverage 40.20% 39.45% -0.75%
==========================================
Files 18 18
Lines 2512 2585 +73
==========================================
+ Hits 1010 1020 +10
- Misses 1334 1396 +62
- Partials 168 169 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
c4d47de
to
4830630
Compare
@@ -60,6 +60,9 @@ spec: | |||
type: object | |||
status: | |||
properties: | |||
lastHeartbeatTime: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是所有的agent 都要 更新 心跳,还只是 gateway node 心跳
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是所有的agent 都要 更新 心跳,还只是 gateway node 心跳
是所有的 agent 都要更新心跳,不是仅为 gateway 的 node。先由 tunnel ready 才会选为 gateway 的可用的节点。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是否 不是 gateway 校色的 节点,不需要 更新 ?避免 大规模集群增加 api 负担
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是否 不是 gateway 校色的 节点,不需要 更新 ?避免 大规模集群增加 api 负担
可以实现,被选中的节点上包心跳。需要再更新下代码。
假设一个场景: |
脑裂这种场景只要分区就会发生,
|
因为是心跳机制,要达到与 api-server 的伪一致性,那么这个与 etcd 失去连接的 agent 应该把 vip 移除(等待超时后) |
讨论结论是,按照 apiserver 超时是,agent 应该摘掉 eip 的方式做。代码还未更新 |
67ec51c
to
1f5e3c9
Compare
## Controller Failover | ||
|
||
EgressGateway 控制面故障转移时,可以通过在安装时指定 `controller.replicas` 参数来控制 Controller 的副本数量。在多个 Controller 副本中的一个发生故障时,系统会自动选择另一个副本作为主要控制器,以确保服务的持续提供。 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
说明下该功能 默认是 开启的,可通过 helm 什么选项 关闭
单独开个 相关 用例 PR, 下个月再合入 |
Datapath Failover 问题排查步骤: | ||
|
||
1. 首先,查看 EgressGateway 应用的安装配置文件 `values.yaml`,确认与 Datapath Failover 相关的配置是否设置合理,特别是确保 `eipEvictionTimeout` 的值大于 `tunnelMonitorPeriod` 加上 `tunnelUpdatePeriod` 的总和; | ||
2. 执行 `kubectl get egt -w` 命令,检查 `EgressTunnel` 的状态。检查选中的 Node 是否处于 `HeartbeatTimeout` 状态,并且是否存在其他处于 `Ready` 状态的 `EgressTunnel`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
检查选中的 Node 是否处于.... 如果有,那么该怎么做
|
||
1. 首先,查看 EgressGateway 应用的安装配置文件 `values.yaml`,确认与 Datapath Failover 相关的配置是否设置合理,特别是确保 `eipEvictionTimeout` 的值大于 `tunnelMonitorPeriod` 加上 `tunnelUpdatePeriod` 的总和; | ||
2. 执行 `kubectl get egt -w` 命令,检查 `EgressTunnel` 的状态。检查选中的 Node 是否处于 `HeartbeatTimeout` 状态,并且是否存在其他处于 `Ready` 状态的 `EgressTunnel`; | ||
3. 如果想查询是否出现过 HeartbeatTimeout 导致的 IP 切换,可以在 controller 容器检索 `update tunnel status to HeartbeatTimeout` 相关的日志。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这是一个后端式的运维,是否 进一步 把 出现过 的问题事件 以 cr 的 event 生成,产品化才能对接 告警,否则 没法 产品化 告警 这么高危的事件
1、心跳策略中关于时间参数的设置可以再讨论下 |
7352b79
to
a2f10b8
Compare
Datapath Failover
背景
因为 Node 的默认 Ready/NotReady 的检测时间为 40s,对于 EgressGateway 来说改时间太长,无法做到快速故障转移。
所以增加一个 EgressTunnel 的心跳机制,实现快速的故障转移。目前 EgressGateway 控制器已经支持了 watch EgressTunnel 的 CR 进行 EIP 选举。所以只需要在 Controller 和 Agent 各自增加一个小的控制起,实现定期更新的 EgressTunnel 状态判断即可。
在处理数据面故障转移时,创建 EgressGateway 可以通过使用
nodeSelector
来选择一组节点作为 Egress Node。Egress IP 将会绑定到其中的一个节点上。当某个节点发生故障时,Egress IP 将会自动转移到另一个可用节点上。设计
通过 Helm 的 values 配置,可以调整状态检测和 Egress IP 转移的时间。
feature.tunnelMonitorPeriod
:Egress Controller 以秒为单位设置的间隔检查 EgressTunnel 的最后更新状态,默认为5
。feature.tunnelUpdatePeriod
:Egress Agent 以秒为单位设置的间隔更新 EgressTunnel 状态,默认为5
。feature.eipEvictionTimeout
:如果 EgressTunnel 的最后更新时间超过此时间,则将节点的 Egress IP 移动到另一个可用节点,单位为秒,默认为15
。Datapath Failover 问题排查步骤:
values.yaml
,确认与 Datapath Failover 相关的配置是否设置合理,特别是确保eipEvictionTimeout
的值大于tunnelMonitorPeriod
加上tunnelUpdatePeriod
的总和;kubectl get egt -w
命令,检查EgressTunnel
的状态。检查选中的 Node 是否处于HeartbeatTimeout
状态,并且是否存在其他处于Ready
状态的EgressTunnel
;备选设计