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

proxy/userspace: respect minSyncInterval #71735

Merged
merged 6 commits into from Apr 17, 2019

Conversation

dcbw
Copy link
Member

@dcbw dcbw commented Dec 5, 2018

The userspace proxy does not have any ratelimiting and when many
services are used will hammer iptables every time a service or
endpoint change occurs.

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

/kind bug
/sig network

The userspace proxy now respects the IPTables proxy's minSyncInterval parameter.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. sig/network Categorizes an issue or PR as relevant to SIG Network. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Dec 5, 2018
@dcbw dcbw force-pushed the userspace-proxy-ratelimiting branch 2 times, most recently from 2cfe08c to d3ef149 Compare December 6, 2018 16:57
@dcbw
Copy link
Member Author

dcbw commented Dec 6, 2018

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Dec 6, 2018
@dcbw
Copy link
Member Author

dcbw commented Dec 6, 2018

/assign @thockin

@dcbw
Copy link
Member Author

dcbw commented Dec 6, 2018

/test pull-kubernetes-e2e-kops-aws

@dcbw
Copy link
Member Author

dcbw commented Dec 6, 2018

/test pull-kubernetes-kubemark-e2e-gce-big

@dcbw dcbw force-pushed the userspace-proxy-ratelimiting branch from 9954110 to 6397110 Compare December 6, 2018 18:16
@danwinship
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 7, 2018
@dcbw
Copy link
Member Author

dcbw commented Dec 19, 2018

@thockin @bowei any thoughts on this one?

@dcbw
Copy link
Member Author

dcbw commented Dec 19, 2018

/retest

@dcbw
Copy link
Member Author

dcbw commented Jan 2, 2019

@thockin @bowei any thoughts on this one after the holidays?

Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

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

IMO this code is as dead as it could be. The only significant user is OpenShift as far as I know. I'd rather never touch it again, but I know that is not realistic.

Also, it seems like maybe this could be broken into a couple commits for easier review?

I raised some questions about this design, but I think you should add yourselves as approvers in OWNERS for this subdir. If it evolves, I will lose context on the impl. I don't think it is covered by e2e, either (more argument for breaking it to a separate repo and having its own e2e tests)

pkg/proxy/userspace/proxier.go Outdated Show resolved Hide resolved
pkg/proxy/userspace/proxier.go Show resolved Hide resolved
pkg/proxy/userspace/proxier.go Outdated Show resolved Hide resolved
pkg/proxy/userspace/roundrobin.go Outdated Show resolved Hide resolved
@dcbw dcbw force-pushed the userspace-proxy-ratelimiting branch from 6397110 to 7bcade9 Compare January 17, 2019 03:39
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 17, 2019
@dcbw
Copy link
Member Author

dcbw commented Jan 17, 2019

Also, it seems like maybe this could be broken into a couple commits for easier review?

@thockin broken into two commits; second commit is largely testcase updates.

@dcbw
Copy link
Member Author

dcbw commented Mar 31, 2019

@thockin I've split out as many things into individual commits as I think I can; let me know if you want me to try splitting "proxy: consolidate ServicesHandler/EndpointsHandler into ProxyProvider" though. Otherwise, PTAL thanks!

@dcbw dcbw force-pushed the userspace-proxy-ratelimiting branch from 9e2728b to 2a42fac Compare April 1, 2019 01:16
@dcbw
Copy link
Member Author

dcbw commented Apr 1, 2019

@danwinship could you do another review too? Thanks!

@dcbw
Copy link
Member Author

dcbw commented Apr 3, 2019

@JacobTanenbaum also might be of interest to you since you're looking at the proxy these days.

pkg/proxy/userspace/proxier.go Outdated Show resolved Hide resolved
pkg/proxy/userspace/proxier_test.go Show resolved Hide resolved
pkg/proxy/userspace/proxier.go Outdated Show resolved Hide resolved
Copy link
Contributor

@danwinship danwinship left a comment

Choose a reason for hiding this comment

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

typo in the last commit message ("consoldiate")

pkg/proxy/userspace/proxier.go Show resolved Hide resolved
pkg/proxy/userspace/proxier.go Outdated Show resolved Hide resolved
pkg/proxy/userspace/proxier.go Outdated Show resolved Hide resolved
pkg/proxy/userspace/proxier.go Show resolved Hide resolved
pkg/proxy/userspace/proxier_test.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 5, 2019
dcbw added 4 commits April 5, 2019 16:16
Proxies should be able to cleanly figure out when endpoints have been synced,
so make all ProxyProviders also implement EndpointsHandler and pass those
through to loadbalancers when required.
If a testcase does time out and 'go test' prints the call stack,
make sure everything from previous tests is cleaned up so the call
stack is easier to understand.
We'll use this shortly to prevent premature syncing before all
initial endpoints and services have been received from the
apiserver.
Keeps things consistent with iptables/IPVS proxies. Proxies don't
handle ServiceTypeExternalName even if the ClusterIP is set.
@dcbw dcbw force-pushed the userspace-proxy-ratelimiting branch from 2a42fac to 9a8e4d3 Compare April 5, 2019 21:22
@dcbw
Copy link
Member Author

dcbw commented Apr 5, 2019

@danwinship @thockin I believe I've addressed all comments. PTAL thanks!

The userspace proxy does not have any ratelimiting and when many
services are used will hammer iptables every time a service or
endpoint change occurs. Instead build up a map of changed
services and process all those changes at once instead of each
time an event comes in. This also ensures that no long-running
processing happens in the same call chain as the OnService*
calls as this blocks other handlers attached to the proxy's
parent ServiceConfig object for long periods of time.

Locking can also now be simplified as the only accesses to the
proxy's serviceMap happen from syncProxyRules(). So instead of
locking in many functions just lock once in syncProxyRules()
like the other proxies do.

https://bugzilla.redhat.com/show_bug.cgi?id=1590589
https://bugzilla.redhat.com/show_bug.cgi?id=1689690
@dcbw dcbw force-pushed the userspace-proxy-ratelimiting branch from 9a8e4d3 to cc2b31a Compare April 5, 2019 21:28
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 5, 2019
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Apr 5, 2019

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

Test name Commit Details Rerun command
pull-kubernetes-e2e-kops-aws aa3f1b0c718ac9ec171c0b438ad7030817ad2ba8 link /test pull-kubernetes-e2e-kops-aws

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.

@dcbw
Copy link
Member Author

dcbw commented Apr 6, 2019

/retest

@danwinship
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 8, 2019
@dcbw
Copy link
Member Author

dcbw commented Apr 8, 2019

@thockin PTAL thanks!

dcbw added a commit to dcbw/kubernetes that referenced this pull request Apr 8, 2019
Per recommendation of @thockin:

kubernetes#71735 (review)

---
IMO this code is as dead as it could be. The only significant user is OpenShift as far as I know. I'd rather never touch it again, but I know that is not realistic.

Also, it seems like maybe this could be broken into a couple commits for easier review?

I raised some questions about this design, but I think you should add yourselves as approvers in OWNERS for this subdir. If it evolves, I will lose context on the impl. I don't think it is covered by e2e, either (more argument for breaking it to a separate repo and having its own e2e tests)
---
Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dcbw, thockin

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 17, 2019
@dcbw
Copy link
Member Author

dcbw commented Apr 17, 2019

@thockin thanks Tim!

@k8s-ci-robot k8s-ci-robot merged commit 2490e03 into kubernetes:master Apr 17, 2019
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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/network Categorizes an issue or PR as relevant to SIG Network. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants