-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Periodically verify that all required iptables rules are present in the Node #628
Comments
I can take a shot at this! |
Awesome @agiannif! Looking forward to your contribution. |
hey @antoninbas , is this still in pipeline for implementation? |
Hey @siddhant94, I had to drop this. Feel free to take it up! |
hey @antoninbas ,apologies for the delay. For the implementation part, I kept track of all rules that are applied in RouteClient while initialization. As part of initialization,I have added a sync loop, a goroutine which given a specified interval runs a check for every rule we have bookmarked in init iptables phase. |
@siddhant94 I don't think you want to use |
@antoninbas Should iptables restore be called everytime sync runs? Or we do it only if we find a rule missing? And also, what do you think should be the sync period? fyi, kube-proxy does it via iptables restore in |
I wasn't aware of the kubelet code. I think for a small number of rules, either approach can work fine. It seems that the current implementation of BTW, it seems that the simplest solution would be to simply call |
Sure @antoninbas . So I am already using the |
…rules are present
Linked the PR @antoninbas . For test, I have extended the TestInitialize in route_test.go (agent). For now I am testing with just one testcase. I'll wait for review comments, then will update collectively more cases if needed. |
…rules are present
…rules are present Add integration test case for iptables syncLoop Fix golangci failing checks Fix review feedback Fix undefined method for interface- golangci-fix
…rules are present Add integration test case for iptables syncLoop Fix golangci failing checks Fix review feedback Fix undefined method for interface- golangci-fix Remove wrong test logic from TestInitialize, introduced during feedback iteration
…rules are present Add integration test case for iptables syncLoop Fix golangci failing checks Fix review feedback Fix undefined method for interface- golangci-fix Remove wrong test logic from TestInitialize, introduced during feedback iteration Fix windows build failure with dummy method
…syncs iptables. RouteClient exposes Run method, which waits for iptables to be initialised, then periodically syncs all antrea required rules to node.
…syncs iptables. Linux RouteClient exposes Run method, which waits for iptables to be initialised, then periodically syncs all antrea required rules to node.
…syncs iptables. Linux RouteClient exposes Run method, which waits for iptables to be initialised, then periodically syncs all antrea required rules to node. IPTablesSyncInterval is exported because we want to configure sync interval in integration tests.
Add a long-running goroutine which periodically syncs iptables. Linux RouteClient exposes Run method, which waits for iptables to be initialised, then periodically syncs all antrea required rules to node. IPTablesSyncInterval is exported because we want to configure sync interval in integration tests. Fixes antrea-io#628
Add a long-running goroutine which periodically syncs iptables. Linux RouteClient exposes Run method, which waits for iptables to be initialised, then periodically syncs all antrea required rules to node. IPTablesSyncInterval is exported because we want to configure sync interval in integration tests. Fixes antrea-io#628
Add a long-running goroutine, which waits for iptables to be initialised, before periodically syncing it. Fixes antrea-io#628
Add a long-running goroutine which periodically syncs iptables. To be able to configure the sync interval for integration tests, IPTablesSyncInterval is exported. Fixes antrea-io#628
Add a long-running goroutine which periodically syncs iptables. To be able to configure the sync interval for integration tests, IPTablesSyncInterval is exported. Fixes #628
Describe what you are trying to solve
This is similar to #627 in spirit, but for iptables rules instead of gw0 routes.
Describe the solution you have in mind
We should verify that all iptables rules required by Antrea are present, in case some other process removes them (or a rule is removed manually by mistake). kube-proxy does something similar: https://github.com/kubernetes/kubernetes/blob/v1.18.2/pkg/proxy/iptables/proxier.go#L503
Describe how your solution impacts user flows
Nothing changes for the user, Antrea becomes more robust.
Describe the main design/architecture of your solution
A new go routine in RouteClient to sync-up iptables rules periodically.
Test plan
A new e2e test can be added to check that an iptables rule "owned" by Antrea gets added back within a reasonable amount of time when it is deleted manually.
The text was updated successfully, but these errors were encountered: