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

Fixes NodePort in ipv6 with proxy-mode=ipvs #71035

Merged
merged 3 commits into from Dec 10, 2018

Conversation

uablrek
Copy link
Contributor

@uablrek uablrek commented Nov 14, 2018

Use ipv6 addresses for NodePort with proxy-mode=ipvs in a ipv6-only cluster.

What type of PR is this?

/kind bug

What this PR does / why we need it:

This affects ipv6-only cluster with proxy-mode=ipvs only.

In an ipv6-only cluster the address scanning function used for setting up NodePort rules in ipvs ipvs return ipv4 addresses.

This PR ensures that ipv6 addresses are returned by the scanning function in an ipv6-only cluster. This makes NodePort work in an ipv6-only cluster with proxy-mode=ipvs.

Which issue(s) this PR fixes

Fixes #68437

Special notes for your reviewer:

I added a ipv6 flag in the netlinkHandle struct rather than return both ipv4 and ipv6 addresses. The main reason for this is that IHO it reduces the risk for breaking the existing ipv4 function.

I am unsure how this will affect future dual-stack work, but the again I guess nobody knows and maybe it even simplifies.

Only manual testing that NodePort works in ipv6-only/ipvs is performed.

Does this PR introduce a user-facing change?:

NONE

Use ipv6 addresses for NodePort with proxy-mode=ipvs in a
ipv6-only cluster.
@k8s-ci-robot
Copy link
Contributor

@uablrek: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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 kind/bug Categorizes issue or PR as related to a bug. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 14, 2018
@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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. sig/network Categorizes an issue or PR as relevant to SIG Network. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 14, 2018
@uablrek
Copy link
Contributor Author

uablrek commented Nov 14, 2018

/sig network

@Lion-Wei
Copy link

/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 Nov 19, 2018
@uablrek
Copy link
Contributor Author

uablrek commented Nov 19, 2018

/retest

@@ -382,14 +382,14 @@ func NewProxier(ipt utiliptables.Interface,
healthzServer: healthzServer,
ipvs: ipvs,
ipvsScheduler: scheduler,
ipGetter: &realIPGetter{nl: NewNetLinkHandle()},
ipGetter: &realIPGetter{nl: NewNetLinkHandle(nodeIP.To4() == nil)},

Choose a reason for hiding this comment

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

You can use the var isIPv6 instead of nodeIP.To4() == nil

iptablesData: bytes.NewBuffer(nil),
filterChainsData: bytes.NewBuffer(nil),
natChains: bytes.NewBuffer(nil),
natRules: bytes.NewBuffer(nil),
filterChains: bytes.NewBuffer(nil),
filterRules: bytes.NewBuffer(nil),
netlinkHandle: NewNetLinkHandle(),
netlinkHandle: NewNetLinkHandle(nodeIP.To4() == nil),

Choose a reason for hiding this comment

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

Same as above

@uablrek
Copy link
Contributor Author

uablrek commented Nov 19, 2018

@Lion-Wei God point. I will update

@uablrek
Copy link
Contributor Author

uablrek commented Nov 19, 2018

I will also rename the parameter to NewNetLinkHandle ipv6 -> isIPv6 to have consitent naming

@uablrek
Copy link
Contributor Author

uablrek commented Nov 19, 2018

/test pull-kubernetes-verify

@Lion-Wei
Copy link

Lion-Wei commented Nov 21, 2018

/release-note-none
/lgtm
/assign @m1093782566

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 21, 2018
@Lion-Wei
Copy link

xref: #71202

@m1093782566
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: m1093782566, 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 Nov 21, 2018
@m1093782566
Copy link
Contributor

I think this bug fix should be in v1.13.

/milestone v1.13

@k8s-ci-robot k8s-ci-robot added this to the v1.13 milestone Nov 29, 2018
@m1093782566
Copy link
Contributor

Adding label
/priority critical-urgent

as it may break an IPV6 cluster.

@k8s-ci-robot k8s-ci-robot added priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 29, 2018
@AishSundar
Copy link
Contributor

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 29, 2018
@AishSundar
Copy link
Contributor

@uablrek @m1093782566 was this PR meant for 1.13? we no longer accept merges into 1.13 branch and only extremely critical urgent fixes can to be CP'ed if needed.

@uablrek
Copy link
Contributor Author

uablrek commented Nov 29, 2018

I think at the time of creation the version was still "1.13...something" so it should work if the patch can be applied. Note that this is a problem only for ipv6-only in combination with proxy-mode=ipvs. The most common is still proxy-mode=iptables which seem to work. So maybe this can slide to 1.14 but if it is possible to document that ipv6+proxy-mode=ipvs is not supported <1.14 it may save some time for new ipv6 users.

@nikopen
Copy link
Contributor

nikopen commented Nov 29, 2018

It's a pretty rare cluster conf combination for people to use directly 1.13.0 in production..

@uablrek This can be cherry picked back to 1.13.1 after it merges on master right?

It can be in the release notes that the patch will go in on 1.13.1 @marpaia

/milestone v1.14

@k8s-ci-robot k8s-ci-robot modified the milestones: v1.13, v1.14 Nov 29, 2018
@uablrek
Copy link
Contributor Author

uablrek commented Nov 29, 2018

@nikopen Not much have happened in the code as far as I know, and the base was 1.13... so I am pretty sure it can be cherry-picked.

@AishSundar
Copy link
Contributor

Thanks all

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 29, 2018
@m1093782566
Copy link
Contributor

m1093782566 commented Dec 10, 2018

/release-note-none

Putting this PR into merge pool...

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Dec 10, 2018
@m1093782566
Copy link
Contributor

/milestone clear

@k8s-ci-robot k8s-ci-robot removed this from the v1.14 milestone Dec 10, 2018
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

1 similar comment
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note-none Denotes a PR that doesn't merit a release note. sig/network Categorizes an issue or PR as relevant to SIG Network. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In ipv6-only cluster with proxy-mode=ipvs ipv4 entries are used for NodePort
7 participants