Kubernetes SIG Network 计划在 Kubernetes 1.40 中移除 kube-proxy 的 IPVS 后端
Kubernetes SIG Network 宣布计划在 Kubernetes 1.40 中移除 kube-proxy 的 IPVS 后端,该后端已在 Kubernetes 1.35 中正式弃用。目前它仍可使用,但会发出弃用警告,所有 IPVS 用户应迁移到 nftables 或 iptables 后端。
IPVS 后端最初是为解决 iptables 在数据面和控制面的扩展性问题而构建的,它利用内核哈希表并避免重写整个规则集。然而,内核 IPVS API 被证明与 Kubernetes Services API 匹配不佳:该后端始终未能实现全部功能,许多特性仍需回退到 iptables,并且缺乏批量更新操作。其调度器选项也几乎没有实际收益,因为各节点上的 kube-proxy 进程不共享调度器状态。此外,Red Hat 计划从 RHEL 中完全移除 iptables API,这也将导致 IPVS 后端在 RHEL 上不可用。
推荐的迁移路径是 nftables 后端,它在 Kubernetes 1.33 中已 GA,适用于运行 Kubernetes 1.36 及以上且内核版本为 5.13 及以上的集群。它得到完全支持、功能完整,性能略优于 IPVS;迁移只需修改 kube-proxy ConfigMap 中的 mode 并重启 kube-proxy pod。
无法使用 nftables 的集群可以切换到 iptables 后端,该后端自 2017 年以来通过优化的规则集、增量更新和更快的重同步有了显著改进,但 SIG 建议在修改配置后重启每个节点。KEP-5495 包含完整的弃用时间表。
Kubernetes SIG Network schedules removal of the kube-proxy IPVS backend in Kubernetes 1.40
Kubernetes SIG Network has announced plans to remove the kube-proxy IPVS backend in Kubernetes 1.40, after officially deprecating it in Kubernetes 1.35. The backend is currently still available but emits a deprecation warning, and all IPVS users are advised to migrate to either the nftables or iptables backend.
The IPVS backend was originally built to fix iptables' data plane and control plane scaling problems, using kernel hash tables and avoiding full ruleset rewrites. However, the kernel IPVS API proved a poor match for the Kubernetes Services API: the backend never achieved full feature parity, fell back to iptables for many features, and suffered from a lack of batch update operations. Its scheduler options also offer little benefit because kube-proxy processes on different nodes do not share scheduler state. Additionally, Red Hat's plan to remove the iptables API from RHEL would make the IPVS backend unusable there as well.
The recommended migration path is the nftables backend, GA since Kubernetes 1.33, for clusters on Kubernetes 1.36 or later with kernel 5.13 or newer. It is fully supported, feature-complete, and has slightly better performance than IPVS; switching is a matter of changing the kube-proxy ConfigMap mode and restarting kube-proxy pods.
Clusters that cannot use nftables may switch to the iptables backend, which has improved substantially since 2017 through optimized rulesets, incremental updates, and faster resyncing, though the SIG recommends rebooting each node after the configuration change. KEP-5495 contains the full deprecation timeline.
猎鹰不保存原文正文。标题与摘要用于快速发现信息,事实细节请以来源原文为准。