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

Fix IPv6 addresses lost issue in pure ipv6 vsphere environment #86001

Merged
merged 1 commit into from Dec 9, 2019

Conversation

hubv
Copy link
Contributor

@hubv hubv commented Dec 6, 2019

What type of PR is this?

/kind bug

What this PR does / why we need it:
with this bug fix, k8s could get both ipv6/ipv4 addresses from vsphere platform, meanwhile k8s could ignore link-local addresses while retrieves VM’s IP.

VMware tools can collect IP addresses on VM, and provide them to k8s.
those IP addresses contain both ipv4/ipv6 addresses, and some useless link-local addresses
e.g.
70368878-72c33b80-18eb-11ea-8349-5aef9103c088
From the code
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go#L682-L700
we can know that while the provider retrieves VM’s IP, It uses To4() function for all IP addresses from vsphere platform, this function will ignore all ipv6 address, and can't filter out ipv4 link-local addresses.
70368733-b321ba00-18e9-11ea-8200-dcdb89fec0b9
It will cause IPv6 addresses lost in node status.

[root@henry-c1 ~]# kubectl get nodes -o wide
NAME        STATUS   ROLES    AGE    VERSION   INTERNAL-IP   EXTERNAL-IP   OS-IMAGE                                      KERNEL-VERSION               CONTAINER-RUNTIME
henry-c1    Ready    <none>   6h9m   v1.15.4   <none>        <none>        Red Hat Enterprise Linux Server 7.6 (Maipo)   3.10.0-1062.1.2.el7.x86_64   docker://1.13.1

and we can't use helm in a vsphere pure ipv6 env

[root@henry-c1 ~]# helm install
Error: forwarding ports: error upgrading connection: no preferred addresses found; known addresses: []

In this PR, we use !ParseIP(ip).IsLinkLocalUnicast() to retrieves VM’s IP
70368813-8621d700-18ea-11ea-8bd1-ef4b90ef0a4d
we can get ipv6 address in node status by this fix, and can use helm in a pure ipv6 vsphere env

[root@henry-c1 ~]# kubectl get nodes -o wide
NAME        STATUS   ROLES    AGE    VERSION                                  INTERNAL-IP         EXTERNAL-IP         OS-IMAGE                                      KERNEL-VERSION               CONTAINER-RUNTIME
henry-c1    Ready    <none>   2d9h   v1.15.7-beta.0.16+6be749574d9801-dirty   2650:1:87:96::113   2650:1:87:96::113   Red Hat Enterprise Linux Server 7.6 (Maipo)   3.10.0-1062.1.2.el7.x86_64   docker://1.13.1

Which issue(s) this PR fixes:

Fixes #85886 #83584

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Fix IPv6 addresses lost issue in pure ipv6 vsphere environment

@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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. 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 Dec 6, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @hubv. 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 Dec 6, 2019
@k8s-ci-robot k8s-ci-robot added area/cloudprovider sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Dec 6, 2019
@hubv
Copy link
Contributor Author

hubv commented Dec 6, 2019

please help to review and merge
We are blocking by issue #85886
I think I can fix the issue by this PR
@kubernetes/cloud-provider
/sig cloud-provider
@SandeepPissay @abrarshivani @imkin @dchen1107
Thanks a lot

@hubv
Copy link
Contributor Author

hubv commented Dec 6, 2019

/assign @BaluDontu

@dims
Copy link
Member

dims commented Dec 8, 2019

/ok-to-test
/priority important-soon

@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. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Dec 8, 2019
@dims
Copy link
Member

dims commented Dec 8, 2019

/assign @frapposelli

@hubv
Copy link
Contributor Author

hubv commented Dec 9, 2019

/test pull-kubernetes-e2e-gce-device-plugin-gpu

@frapposelli
Copy link
Member

@hubv thanks for this PR!

/lgtm
/approve

/cc @dvonthenen @andrewsykim PTAL, not sure if this was already fixed in out-of-tree

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: frapposelli, hubv

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 Dec 9, 2019
@k8s-ci-robot k8s-ci-robot merged commit ed8a260 into kubernetes:master Dec 9, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Dec 9, 2019
@dvonthenen
Copy link

@frapposelli thanks for the heads up! IPv6 support was addressed in the external provider a few weeks back.

@hubv
Copy link
Contributor Author

hubv commented Dec 10, 2019

/cc
Could someone help to cherry-pick this fix into v1.17.x or v1.16.x?Then we can adopt it before v1.18.
Thank you

@k8s-ci-robot
Copy link
Contributor

@hubv: GitHub didn't allow me to request PR reviews from the following users: hubv.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc
Could someone help to cherry-pick this fix into v1.17.x or v1.16.x?Then we can adopt it before v1.18.
Thank you

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 added a commit that referenced this pull request Jan 9, 2020
…pstream-release-1.17

Automated cherry pick of #86001: Fix IPv6 addresses lost issue in pure ipv6 vsphere
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jan 20, 2020
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/cloudprovider 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/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. 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.

ipv6 support issue for vsphere cloud privider
6 participants