Skip to content
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

iptables,option,node: Consistent condition for ipset usage #18788

Merged
merged 1 commit into from
Feb 18, 2022

Conversation

pchaigno
Copy link
Member

This pull request fixes a bug where we would create ipsets and fill them with IP addresses even though they would never be used by our iptables rules.

To fix this, we introduce a new NodeIpsetNeeded helper function, such that there is a single place where we define whether node ipsets should be used. This helper function is then used both to create ipset iptables rules and add IP addresses to ipsets.

Fixes: #16603.
Related: #18787.

Fix bug where unnecessary ipset was created and populated in tunneling mode with iptables masquerading.

@pchaigno pchaigno added kind/bug This is a bug in the Cilium logic. release-note/bug This PR fixes an issue in a previous release of Cilium. needs-backport/1.11 labels Feb 11, 2022
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from master in 1.11.2 Feb 11, 2022
@pchaigno pchaigno marked this pull request as ready for review February 11, 2022 18:10
@pchaigno pchaigno requested a review from a team February 11, 2022 18:10
@pchaigno pchaigno requested a review from a team as a code owner February 11, 2022 18:10
@pchaigno pchaigno requested review from a team and ldelossa February 11, 2022 18:10
Copy link
Contributor

@ldelossa ldelossa left a comment

Choose a reason for hiding this comment

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

LGTM

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Feb 16, 2022
@nebril nebril added the dont-merge/needs-rebase This PR needs to be rebased because it has merge conflicts. label Feb 17, 2022
This commit fixes a bug where we would create ipsets and fill them with
IP addresses even though they would never be used by our iptables rules.

To fix this, we introduce a new NodeIpsetNeeded helper function, such
that there is a single place where we define whether node ipsets should
be used. This helper function is then used both to create ipset iptables
rules and add IP addresses to ipsets.

Fixes: 49cb220 ("iptables: Don't masquerade traffic to cluster nodes")
Signed-off-by: Paul Chaignon <paul@cilium.io>
@pchaigno pchaigno removed ready-to-merge This PR has passed all tests and received consensus from code owners to merge. dont-merge/needs-rebase This PR needs to be rebased because it has merge conflicts. labels Feb 17, 2022
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Feb 17, 2022
@pchaigno pchaigno force-pushed the fix-condition-for-using-ipset branch from cda325b to ef9e67e Compare February 17, 2022 10:11
@pchaigno
Copy link
Member Author

/test

@nebril nebril removed the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Feb 17, 2022
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Feb 17, 2022
@nebril nebril merged commit 573f6b8 into cilium:master Feb 18, 2022
@pchaigno pchaigno deleted the fix-condition-for-using-ipset branch February 18, 2022 09:22
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from master to Backport pending to v1.10 in 1.11.2 Feb 23, 2022
@joestringer joestringer added the backport-done/1.11 The backport for Cilium 1.11.x for this PR is done. label Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-done/1.11 The backport for Cilium 1.11.x for this PR is done. kind/bug This is a bug in the Cilium logic. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
No open projects
1.11.2
Backport pending to v1.10
Development

Successfully merging this pull request may close these issues.

None yet

4 participants