DEBUG.WIKI
PanstarCloud:部署应用,接入 AI,云服务器与 AI 网关
晚安云;香港 CN2 ¥15/月
V.PS:让项目靠近用户,亚太、欧洲、北美 KVM VPS

解决 Calico 报错 Felix failed to cleanup ipset: Set is busy

分析 Calico 规则轮转报 failed to cleanup ipset Set cannot be destroyed: it is in use 根因,详解 iptables 引用解绑与安全清理方案。

问题现象

Calico Felix 日志中持续刷屏警告,旧的网络策略集合无法释放:

2026-11-15 14:40:10.123 [WARN][1] felix/ipsets.go 500: Failed to delete old ipset cali40old-set. error=exit status 1: ipset v7.15: Set cannot be destroyed: it is in use by a kernel component!

触发根因

  1. 该 ipset 集合仍然被某条 iptables 规则所引用:旧的规则链未被彻底卸载前,直接尝试销毁集合被内核拒绝。

诊断排查步骤

  1. 查找引用该集合的 iptables 规则:
iptables-save | grep cali40old-set

解决步骤与操作命令

步骤一:手动删除引用该集合的具体 iptables 规则

iptables -D <CHAIN_NAME> -m set --match-set cali40old-set dst -j ACCEPT

步骤二:安全销毁该无用集合

ipset destroy cali40old-set

步骤三:触发 Felix 重新同步

kubectl rollout restart ds calico-node -n kube-system

验证方法

观察 Felix 最新日志: 未再出现 Set is busy 告警,过期集合被干净释放。