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

Ensure the KUBE-MARK-DROP chain in kube-proxy mode=ipvs #82214

Merged
merged 1 commit into from
Sep 3, 2019

Conversation

uablrek
Copy link
Contributor

@uablrek uablrek commented Sep 1, 2019

What type of PR is this?
/kind bug
/sig network
/area ipvs

What this PR does / why we need it:

The kube-proxy expects the KUBE-MARK-DROP to exist. This chain is created by kubelet, it works but creates an unnecessary race. Ensuring the chain in both kube-proxy and kubelet removes the race without affecting the function.

Also in dual-stack the KUBE-MARK-DROP is only created for the "cluster default" family by kubelet so dual-stack operation fails for kube-proxy unless the chain is created by other means, e.g with;

ip6tables -t nat -N KUBE-MARK-DROP

Which issue(s) this PR fixes:

Fixes #80462

Special notes for your reviewer:

Nobody seem to remember why the KUBE-MARK-DROP is created by kubelet.

Does this PR introduce a user-facing change?:

Ensure the KUBE-MARK-DROP chain in kube-proxy mode=ipvs. The chain is ensured for both ipv4 and ipv6 in dual-stack operation.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. sig/network Categorizes an issue or PR as relevant to SIG Network. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. area/ipvs 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 Sep 1, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @uablrek. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 1, 2019
@uablrek uablrek changed the title Ensure the KUBE-MARK-DROP chain in kube-proxy Ensure the KUBE-MARK-DROP chain in kube-proxy mode=ipvs Sep 1, 2019
@danwinship
Copy link
Contributor

Nobody seem to remember why the KUBE-MARK-DROP is created by kubelet.

mostly by analogy with KUBE-MARK-MASQ, which is used by both the proxy and by the kubelet HostPort code, and so it was felt that it made more sense to have kubelet create it and kube-proxy/hostport just consume it. (See #82125).

But yes, there is a race, and it makes sense for the proxy to create the chains it needs (but to leave kubelet to fill in the rules).

/lgtm

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

khenidak commented Sep 3, 2019

/test pull-kubernetes-bazel-build

@khenidak
Copy link
Contributor

khenidak commented Sep 3, 2019

/lgtm

@andrewsykim
Copy link
Member

/approve

@andrewsykim
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 3, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewsykim, uablrek

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 Sep 3, 2019
@andrewsykim
Copy link
Member

@uablrek can you update release notes please?

@uablrek
Copy link
Contributor Author

uablrek commented Sep 3, 2019

@danwinship Thanks for the ref to #82125, a very good compilation of facts! I am sorry I missed it.

But I disagree with the proposal. IMO all binaries that uses any chain should ensure it's existence. The name "EnsureChain" is very good. The agreement should be what binary that shall remove it. There is a PR that I can't find that make sure the chain is not removed by kube-proxy.

@uablrek
Copy link
Contributor Author

uablrek commented Sep 3, 2019

@andrewsykim

can you update release notes please?

I don't know how, but I am willing to learn 😄 @khenidak helped with the release note.

@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. labels Sep 3, 2019
@andrewsykim
Copy link
Member

/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. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. labels Sep 3, 2019
@danwinship
Copy link
Contributor

@uablrek So, yes, as I said above, it's good for kube-proxy to ensure that the chain exists (since they can't write out rules jumping to it otherwise), but there has to be only a single place where we add the rules to those chains, because those rules are configurable, and can change between releases, and we don't have a good way to ensure that kubelet and kube-proxy get configured the same way, and we're not guaranteed to always be running the same versions of kubelet and kube-proxy during a cluster upgrade.

@andrewsykim
Copy link
Member

/milestone v1.16

@k8s-ci-robot k8s-ci-robot added this to the v1.16 milestone Sep 3, 2019
@andrewsykim
Copy link
Member

/lgtm

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. area/ipvs 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kube-proxy/ipvs; sync logs fault on master; KUBE-MARK-DROP missing
5 participants