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

Making iptables probability more granular in kube-proxy. #83599

Merged
merged 1 commit into from
Oct 8, 2019

Conversation

robscott
Copy link
Member

@robscott robscott commented Oct 8, 2019

What type of PR is this?
/kind bug

What this PR does / why we need it:
Until now, iptables probabilities generated by kube-proxy had 5 decimal places of granularity. That meant that probabilities would start to repeat once a Service had 319 or more endpoints resulting in poor distribution. This doubles the granularity to 10 decimal places, ensuring that probabilities will not repeat until a Service reaches 100,223 endpoints.

I tested this out with 10k endpoints running on a 150 node Kubernetes cluster. I've included some of the generated iptables output before and after this change in a Gist.

Does this PR introduce a user-facing change?:

kube-proxy iptables probabilities are now more granular and will result in better distribution beyond 319 endpoints.

/sig network
/cc @freehan

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Oct 8, 2019
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. sig/network Categorizes an issue or PR as relevant to SIG Network. 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 Oct 8, 2019
@robscott
Copy link
Member Author

robscott commented Oct 8, 2019

/priority important-longterm

@k8s-ci-robot k8s-ci-robot added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Oct 8, 2019
Until now, iptables probabilities had 5 decimal places of granularity.
That meant that probabilities would start to repeat once a Service
had 319 or more endpoints.

This doubles the granularity to 10 decimal places, ensuring that
probabilities will not repeat until a Service reaches 100,223 endpoints.
@vllry
Copy link
Contributor

vllry commented Oct 8, 2019

iptables apparently uses "a granularity of 1/2147483648" or ~4.65^(-10) https://manpages.debian.org/unstable/iptables/iptables-extensions.8.en.html

I'll give an LGTM since it checks out.

/lgtm

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

freehan commented Oct 8, 2019

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: freehan, robscott

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 Oct 8, 2019
@k8s-ci-robot k8s-ci-robot merged commit d8a3fbd into kubernetes:master Oct 8, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Oct 8, 2019
ohsewon pushed a commit to ohsewon/kubernetes that referenced this pull request Oct 16, 2019
Making iptables probability more granular in kube-proxy.
@robscott robscott deleted the iptables-probability branch March 11, 2021 04:54
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-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. 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/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.

None yet

4 participants