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

Fix a bug when a namespace has two egress IPs on same node #19926

Merged

Conversation

danwinship
Copy link
Contributor

#19603 was supposed to make us sanity-check-but-ignore additional egress IPs on a namespace, but it accidentally made it so that the iptables rules for the IP would get set up anyway. In the sane case where the namespace had multiple egress IPs on different nodes, this had no visible effect, because no one was sending egress traffic for the namespace to the second node anyway, so it just had a useless iptables rule. But if you had two egress IPs for the same namespace on the same node (which is stupid, but...) then they'd both get set up on that node, and the second one ended up having priority over the first one.

This fixes it so that only the first egress IP for a namespace ever gets set up. (#19578 will need a larger fix.)

The change to updateNamespaceEgress is to deal with:

  • Set node-1's egressIPs to ["1.1.1.1", "2.2.2.2"]
  • Set namespace-A's egressIPs to ["1.1.1.1"] (which will add OVS and iptables rules for 1.1.1.1)
  • Set namespace-A's egressIPs to ["2.2.2.2", "1.1.1.1"] (which needs to add OVS and iptables rules for 2.2.2.2 and remove them for 1.1.1.1, but in order to make the latter happen, we have to add 1.1.1.1 to the "changed" list, even though it didn't actually change)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1585947

@danwinship danwinship added kind/bug Categorizes issue or PR as related to a bug. component/networking sig/networking labels Jun 6, 2018
@danwinship danwinship requested a review from knobunc June 6, 2018 19:21
@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 6, 2018
Copy link
Contributor

@knobunc knobunc left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks Dan

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 6, 2018
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danwinship, knobunc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knobunc
Copy link
Contributor

knobunc commented Jun 6, 2018

/retest

@knobunc knobunc closed this Jun 6, 2018
@knobunc knobunc reopened this Jun 6, 2018
@knobunc
Copy link
Contributor

knobunc commented Jun 6, 2018

/retest

1 similar comment
@0xmichalis
Copy link
Contributor

/retest

@openshift-merge-robot openshift-merge-robot merged commit aaefcd8 into openshift:master Jun 6, 2018
@danwinship danwinship deleted the egress-ip-duplicates branch June 7, 2018 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/networking kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. sig/networking size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants