fix(egress): isolate nftables tables by instance

Signed-off-by: Gabriele Pennacchia <gabriele@pennacchia.it>
This commit is contained in:
Gabriele Pennacchia
2026-07-14 09:47:34 +02:00
parent 18fd79aa5d
commit 60c786b537
19 changed files with 613 additions and 59 deletions

View File

@@ -116,6 +116,15 @@ func (p *Processor) AddOrModify(ctx context.Context, event watch.Event, serviceF
return nil
}
// The Service annotation is cluster-wide while nftables state is local to
// each node. Reconcile stale per-Service chains on every node after a table
// migration, even when this kube-vip pod is not the Service leader.
if svc.Annotations[kubevip.EgressNftablesTable] != "" {
if err := p.cleanupStaleEgressNftablesChains(svc); err != nil {
log.Warn("failed to clean stale nftables egress chains", "service", svc.Name, "namespace", svc.Namespace, "err", err)
}
}
svcAddresses, svcHostnames := instance.FetchServiceAddresses(svc)
// We only care about LoadBalancer services that have been allocated an address