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

kube-proxy/iptables: optimize endpoint map creation by excluding invalid endpoints earlier #42747

Merged
merged 2 commits into from Mar 15, 2017

Conversation

dcbw
Copy link
Member

@dcbw dcbw commented Mar 8, 2017

We don't need to do as much work as we were doing, if we exclude invalid endpoints earlier in the endpoints processing.

Fixes: #42210

@freehan @liggitt @thockin if you could review this with a fine-toothed comb... I can't immediately think of why invalid endpoints would be useful for the HealthChecker, and this PR prevents the HC from seeing these endpoints.

dcbw added 2 commits March 7, 2017 13:32
We don't need the svcPortToInfoMap.  Its only purpose was to
send "valid" local endpoints (those with valid IP and >0 port) to the
health checker.  But we shouldn't be sending invalid endpoints to
the health checker anyway, because it can't do anything with them.

If we exclude invalid endpoints earlier, then we don't need
flattenValidEndpoints().

And if we don't need flattenValidEndpoints() it makes no sense to have
svcPortToInfoMap store hostPortInfo, since endpointsInfo is the same
thing as hostPortInfo except with a combined host:port.

And if svcPortToInfoMap now only stores valid endpointsInfos, it is
exactly the same thing as newEndpoints.
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 8, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

The following people have approved this PR: dcbw

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

We suggest the following people:
cc @matchstick
You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-label-needed labels Mar 8, 2017
@dcbw
Copy link
Member Author

dcbw commented Mar 8, 2017

@freehan can you test with your setup as well? I don't have the capacity to do that, so I was testing with 250 services, each with 30 endpoints.

pperf from this PR: http://people.redhat.com/dcbw/new-steady.svg
pperf without this PR: http://people.redhat.com/dcbw/old-steady.svg

@dcbw
Copy link
Member Author

dcbw commented Mar 8, 2017

@kubernetes/rh-networking @kubernetes/sig-network-misc

@dcbw
Copy link
Member Author

dcbw commented Mar 8, 2017

Looks like net issues with gcr.io? @k8s-bot cvm gce e2e test this

@ethernetdan
Copy link
Contributor

@bprashanth @matchstick how does this look? this is a blocker for 1.6

@ethernetdan
Copy link
Contributor

/cc @thockin

@thockin
Copy link
Member

thockin commented Mar 15, 2017

Nice cleanup - @dcbw is it really a blocker? What's the measured impact?

@thockin thockin added approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels Mar 15, 2017
@thockin thockin added this to the v1.6 milestone Mar 15, 2017
@thockin
Copy link
Member

thockin commented Mar 15, 2017

NM, I see this is the perf regression. Awesome.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Mar 15, 2017

@dcbw: The following test(s) failed:

Test name Commit Details Rerun command
Jenkins GCE e2e f7630f8 link @k8s-bot cvm gce e2e test this

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.

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 42747, 43030)

@k8s-github-robot k8s-github-robot merged commit 1b4433d into kubernetes:master Mar 15, 2017
k8s-github-robot pushed a commit that referenced this pull request Apr 6, 2017
…ts-log-message

Automatic merge from submit-queue

Restore "Setting endpoints" log message

**What this PR does / why we need it**:

The "Setting endpoints" message from kube-proxy at high verbosity was
lost as part of a larger simplification in #42747.

This change brings it back, simply outputting the just-constructed
addresses list.

I need this message to monitor delays in propagating endpoints changes across nodes.

**Release note**:

```release-note
NONE
```
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants