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

Don't allow claiming node IP as egress IP #16779

Merged

Conversation

danwinship
Copy link
Contributor

@danwinship danwinship added component/networking kind/bug Categorizes issue or PR as related to a bug. sig/networking labels Oct 10, 2017
@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 10, 2017
@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 10, 2017
@pravisankar
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 10, 2017
@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@@ -245,6 +245,10 @@ func (eip *egressIPWatcher) deleteNamespaceEgress(vnid uint32) {
}

func (eip *egressIPWatcher) claimEgressIP(egressIP, egressHex string) error {
if egressIP == eip.localIP {
Copy link
Contributor

Choose a reason for hiding this comment

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

That means if the master is not also configured as a node, the master IP will still be able to set as egressIPs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The code for claiming egress IPs is part of the node code; if the master isn't a node then it can't claim egress IPs at all.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I meant that as the bug described. I can add the master host IP as the egressIPs to node which will make the node to master connection broken.

The fix is going to check the node hosts IPs should not be added as egressIPs.
But for condition that the master only roles as master, but not node. Then the master host IP will still be able to add to nodes as egressIPs.

My env like:
host1: master
host2: node1
host3: node2

After the fix, the host1's IP will still be able to add to node1 or node2 since the host1 is not a node. But it will still break the node to master connection after that.

Choose a reason for hiding this comment

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

Currently, we only validate EgressIP has valid IP (also IPv4 with #16807) but I think we should ensure it does not overlap with other cidrs (node/service/ingress/external...) and master IPs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bmeng: we can't really validate that the IP address is totally unused anyway; there might be other machines on the same subnet that aren't nodes/master. egress-router has the same issue. But in both cases, only cluster admins can set those IPs anyway, so we can just tell them "be careful"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pravisankar the EgressIP has to be on the same subnet as the node's primary IP, which we have already verified doesn't overlap with the other CIDRs.

Choose a reason for hiding this comment

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

@danwinship Where did we check 'EgressIP is on the same subnet as the node's primary IP'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, indeed, we don't; we add it to the primary interface, so it probably won't work right otherwise, but we don't actually check it. I'll fix that

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot
Copy link
Contributor

/test all [submit-queue is verifying that this PR is safe to merge]

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue (batch tested with PRs 16725, 16779, 16798, 16783, 16740).

@openshift-merge-robot openshift-merge-robot merged commit ba7ae7f into openshift:master Oct 11, 2017
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 11, 2017

@danwinship: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/openshift-jenkins/integration ef92ca1 link /test integration

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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 kubernetes/test-infra repository. I understand the commands that are listed here.

@imcsk8
Copy link
Contributor

imcsk8 commented Oct 12, 2017

LGTM

@danwinship danwinship mentioned this pull request Oct 13, 2017
@danwinship danwinship deleted the egress-ip-node-ip branch October 19, 2017 19:04
openshift-merge-robot added a commit that referenced this pull request Oct 20, 2017
Automatic merge from submit-queue.

Egress IP fixes

1. Further IP address validation, from #16779 (comment)
2. Fix OVS VXLAN ingress rule to not filter out remote node egress IP traffic, fixing https://bugzilla.redhat.com/show_bug.cgi?id=1501876
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants