元鉴
返回中文阅读流

Kubernetes Blog

Kubernetes v1.36:云控制器管理器中的路由同步新指标

本文原发布日期有误,后于 2026 年 5 月 15 日重新发布。Kubernetes v1.36 为 CCM 路由控制器实现引入新 alpha 计数器指标 route_controller_route_sync_total,每次与云提供商同步路由时递增。

中文内容

已翻译official company source英文原文2026-05-15

Kubernetes v1.36:Cloud Controller Manager 中路由同步的新指标

By Lukas Metzner (Hetzner) | Friday, May 15, 2026

本文最初发布时日期有误。后于 2026 年 5 月 15 日重新发布。

Kubernetes v1.36 在位于 k8s.io/cloud-provider 的 Cloud Controller Manager (CCM) 路由控制器实现中,引入了一个新的 Alpha 级计数器指标 route_controller_route_sync_total。该指标会在每次路由与云提供商同步时递增。

基于 Watch 的路由协调 A/B 测试

添加此指标旨在帮助运维人员验证 Kubernetes v1.35 引入的 CloudControllerManagerWatchBasedRoutesReconciliation 特性开关。该特性开关将路由控制器由固定间隔循环改为基于 Watch 的机制,仅在节点实际发生变更时才执行协调操作。此举减少了对基础设施提供商的不必要 API 调用,缓解了受速率限制 API 的压力,使运维人员能够更高效地利用其可用配额。

若要进行 A/B 测试,请对比该特性开关处于禁用(默认)状态与启用状态时的 route_controller_route_sync_total 指标。在节点变更不频繁的集群中,启用该特性开关后,您应会观察到同步率显著下降。

示例:预期行为

禁用特性开关(默认的固定间隔循环)时,无论是否发生节点变更,计数器都会稳定递增:

# After 10 minutes with no node changes
route_controller_route_sync_total 60
# After 20 minutes, still no node changes
route_controller_route_sync_total 120

启用特性开关(基于 watch 的协调机制)时,计数器仅在节点实际被添加、删除或更新时才会递增:

# After 10 minutes with no node changes
route_controller_route_sync_total 1
# After 20 minutes, still no node changes — counter unchanged
route_controller_route_sync_total 1
# A new node joins the cluster — counter increments
route_controller_route_sync_total 2

这种差异在节点极少变化的稳定集群中尤为明显。

我可以在哪里提供反馈?

如有任何反馈,欢迎通过以下任一渠道与我们联系:

  • Kubernetes Slack 上的 #sig-cloud-provider 频道
  • GitHub 上的 KEP-5237 议题
  • 用于其他沟通渠道的 SIG Cloud Provider 社区页面

如何了解更多?

更多详情请参阅 KEP-5237。

  • ← 上一篇
  • 下一步 →
Last modified May 09, 2026 at 1:02 PM PST: Republish CCM metric article (d1889ac549)

原文标题

Kubernetes v1.36: New Metric for Route Sync in the Cloud Controller Manager