Skip to content

flannel migration: document removing leftover flannel iptables rules#2768

Open
stitrace wants to merge 1 commit into
tigera:mainfrom
stitrace:docs/flannel-migration-iptables-cleanup
Open

flannel migration: document removing leftover flannel iptables rules#2768
stitrace wants to merge 1 commit into
tigera:mainfrom
stitrace:docs/flannel-migration-iptables-cleanup

Conversation

@stitrace

@stitrace stitrace commented Jun 5, 2026

Copy link
Copy Markdown

Description

The live-migration guide tells you to delete the migration controller once migration completes, but it does not mention that flannel leaves iptables rules behind on every node.

The migration controller removes the flannel daemonset and deletes the flannel network devices (flannel.<vni>, cni0), but it does not remove the iptables chains flannel programs: FLANNEL-POSTRTG (nat) and FLANNEL-FWD (filter). These survive the migration.

The masquerade rule in FLANNEL-POSTRTG keeps SNAT-ing cross-node pod-to-pod traffic to the node's tunnel IP. This is invisible until you use NetworkPolicy: the SNAT'd source no longer matches pod-selector rules, so Calico's default-deny drops the traffic. Symptom after an otherwise successful migration: cross-node connections to policy-selected pods silently time out, while same-node traffic keeps working.

This PR adds a cleanup step after "Delete the migration controller" with an idempotent flush command (legacy + nft backends) and a reboot alternative.

Notes

Reproduction

After migrating, on any node: nft list chain ip nat POSTROUTING still shows jump FLANNEL-POSTRTG with non-zero counters; a cross-node listener sees the client's source as the sender node's tunnel IP (<block>.0) rather than the pod IP, and NetworkPolicy-selected pods become unreachable cross-node.

The live-migration controller removes the flannel daemonset and deletes the
flannel network devices, but it does not remove the iptables chains flannel
programs (FLANNEL-POSTRTG in nat, FLANNEL-FWD in filter). These survive the
migration and the FLANNEL-POSTRTG masquerade rule keeps SNAT-ing cross-node
pod-to-pod traffic to the node tunnel IP, which silently breaks NetworkPolicy
after migration. Add a cleanup step (with a reboot alternative) so operators
can remove the leftover rules.
@stitrace stitrace requested a review from a team as a code owner June 5, 2026 16:52
@netlify

netlify Bot commented Jun 5, 2026

Copy link
Copy Markdown

Deploy Preview for calico-docs-preview-next ready!

Name Link
🔨 Latest commit 3ff6ed2
🔍 Latest deploy log https://app.netlify.com/projects/calico-docs-preview-next/deploys/6a22feea80813a0008828b34
😎 Deploy Preview https://deploy-preview-2768--calico-docs-preview-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 5, 2026

Copy link
Copy Markdown

Deploy Preview succeeded!

Built without sensitive environment variables

Name Link
🔨 Latest commit 3ff6ed2
🔍 Latest deploy log https://app.netlify.com/projects/tigera/deploys/6a22feea0c9de80008ae1536
😎 Deploy Preview https://deploy-preview-2768--tigera.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 87 (🔴 down 11 from production)
Accessibility: 98 (no change from production)
Best Practices: 83 (🔴 down 9 from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@ctauchen

Copy link
Copy Markdown
Collaborator

@stitrace Thanks for the submission. Someone will take a look at this together with #2768

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants