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

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

This comment has been minimized.

Copy link
Contributor

commented Sep 1, 2019

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.

@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
@k8s-ci-robot k8s-ci-robot requested review from m1093782566 and MrHohn Sep 1, 2019
@danwinship

This comment has been minimized.

Copy link
Contributor

commented Sep 3, 2019

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

@khenidak

This comment has been minimized.

Copy link
Contributor

commented Sep 3, 2019

/test pull-kubernetes-bazel-build

@khenidak

This comment has been minimized.

Copy link
Contributor

commented Sep 3, 2019

/lgtm

@andrewsykim

This comment has been minimized.

Copy link
Member

commented Sep 3, 2019

/approve

@andrewsykim

This comment has been minimized.

Copy link
Member

commented Sep 3, 2019

/ok-to-test

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Sep 3, 2019

[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

@andrewsykim

This comment has been minimized.

Copy link
Member

commented Sep 3, 2019

@uablrek can you update release notes please?

@uablrek

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor Author

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.

@andrewsykim

This comment has been minimized.

Copy link
Member

commented Sep 3, 2019

/priority important-soon

@danwinship

This comment has been minimized.

Copy link
Contributor

commented Sep 3, 2019

@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

This comment has been minimized.

Copy link
Member

commented Sep 3, 2019

/milestone v1.16

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

This comment has been minimized.

Copy link
Member

commented Sep 3, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Sep 3, 2019
@k8s-ci-robot k8s-ci-robot merged commit f71cfdf into kubernetes:master Sep 3, 2019
24 checks passed
24 checks passed
cla/linuxfoundation uablrek authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-conformance-kind-ipv6 Skipped.
pull-kubernetes-cross Skipped.
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-iscsi Skipped.
pull-kubernetes-e2e-gce-iscsi-serial Skipped.
pull-kubernetes-e2e-gce-storage-slow Skipped.
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-node-e2e-containerd Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.