OCPBUGS-99652: prevent duplicate NOTRACK iptables rules on container restart - #3093
OCPBUGS-99652: prevent duplicate NOTRACK iptables rules on container restart#3093ssonigra wants to merge 1 commit into
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Skipping CI for Draft Pull Request. |
|
@ssonigra: This pull request references Jira Issue OCPBUGS-99652, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ssonigra The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…estart Check whether each NOTRACK rule already exists (iptables -C) before appending it. Without this guard, every ovnkube-controller container restart blindly appends duplicate rules for the Geneve and hybrid overlay VXLAN ports. Because NOTRACK is a non-terminating target, duplicates are all evaluated sequentially, inflating packet counters and wasting CPU. Signed-off-by: Saurab Sonigra <ssonigra@redhat.com>
9309251 to
1bc1017
Compare
|
@ssonigra: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
iptables -C(check) before eachiptables -A(append) for NOTRACK rules instart-ovnkube-node()to prevent duplicate rules accumulating on ovnkube-controller container restartsDetails
Every time the ovnkube-controller container restarts (e.g. due to certificate renewal or probe failure), the
ovnkube-lib.shscript unconditionally appends NOTRACK rules for the Geneve and hybrid overlay VXLAN ports. Because NOTRACK is a non-terminating iptables target, all duplicate rules are evaluated sequentially, inflating packet counters and wasting CPU.The fix uses the standard idempotent iptables pattern:
This ensures rules are only added when they don't already exist.
Jira
https://redhat.atlassian.net/browse/OCPBUGS-99652
Test plan
make buildpassesmake test-unitpassesiptables -t raw -L PREROUTING -n -v --line-numbersshows no duplicate NOTRACK rules🤖 Generated with Claude Code via
/jira:solve OCPBUGS-99652