Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Reload router iptables rules if they get cleared #3802

Merged
merged 8 commits into from
Jul 24, 2020
Merged

Conversation

foot
Copy link
Contributor

@foot foot commented May 13, 2020

Adds a CANARY iptable chain and reloads all the weavenet iptable chains if the CANARY is removed by something (usually firewalld).

Partially addresses #3586

Details

  • This exposes ConfigureIPTables and tries to make it safe to call again and again.
  • The destructive resets are pulled out into ResetIPTables and are called at launch so iptable state should remain mostly the same as prior to this PR.

@foot foot requested a review from bboreham May 13, 2020 17:31
Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@foot
Copy link
Contributor Author

foot commented May 15, 2020

Manual testing:

  • I've loaded this up in a 3 node k8s cluster on GCP / RHEL7
  • Disabled the npc container
  • Restart firewalld
  • weave-net recovers all its iptable rules!

Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Few new thoughts below.

@foot
Copy link
Contributor Author

foot commented Jul 3, 2020

@bboreham PTAL at the last 2 commits when you have a moment!

Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good but a few nits in how things are described.

@bboreham bboreham changed the title Reload iptables periodically Reload router iptables rules if they get cleared Jul 6, 2020
foot added 6 commits July 15, 2020 11:35
- Instead of EnsureBridge
- Adds ipset.ExistEntry method
- Refactor ipset method names Exist <-> EntryExists
- Turn on iptable-refresh by default (10s)
- Adds a test that checks iptables are refreshed, check EXPOSE recovers
- Should always be on. Simpler.
@foot foot force-pushed the reload-ip-tables branch from 79eff79 to c0e5008 Compare July 15, 2020 09:40
Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm; one nit about a comment / function name but we can fix that another day if you don't have time now.

@bboreham bboreham merged commit 7b927a7 into master Jul 24, 2020
@bboreham bboreham deleted the reload-ip-tables branch July 24, 2020 13:33
@bboreham bboreham added this to the 2.7 milestone Jul 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants