mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-08 21:14:56 +09:00
The cilium endpoint-leak healer's Tier-1 remedies (cilium-dbg endpoint disconnect, or delete-reschedule the wedged pod) cannot clear a leak that lives purely in the cilium-agent's in-memory state: when IPAM keeps re-handing the SAME released IP, a delete-rescheduled pod re-wedges on it, and on some variants the stale entry isn't even in the queryable endpoint registry so disconnect no-ops. Both produce an inescapable delete -> re-wedge / no-op loop that fails the install on FailedCreatePodSandBox "IP ipv4:<X> is already in use" (cilium/cilium#38313). Add a bounded Tier-2 escalation: track recurrence per (node,ip); once the same IP survives ESCALATE_AFTER heal cycles of Tier-1, restart that node's cilium-agent (delete its pod; the DaemonSet rebuilds it from CRDs/IPAM without the stale entry), capped per node so it can never loop-restart agents. A genuine duplicate-IP (live owner) is refused before counting, so an agent restart never masks a real product bug. Tier-1 stays the first remedy; escalation fires only after it proves futile on the same IP. RBAC needs no new verb: the existing cluster-wide pods get/list/delete already covers deleting a cilium-agent pod in cozy-cilium. Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la>