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

Report Hostname node address for vsphere #67922

Merged
merged 1 commit into from
Aug 29, 2018

Conversation

liggitt
Copy link
Member

@liggitt liggitt commented Aug 28, 2018

xref #67714

NONE

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 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. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. labels Aug 28, 2018
@liggitt
Copy link
Member Author

liggitt commented Aug 28, 2018

/cc @abrarshivani @BaluDontu @divyenpatel @imkin @kerneltime @luomiao @frapposelli @dougm

apologies for the mass cc, not sure who is best positioned to review this. this is a follow up to #65594 making cloud providers authoritative for the node addresses they report, and updates vsphere to report the HostName address it has for the local kubelet to preserve pre-1.12 behavior.

@liggitt
Copy link
Member Author

liggitt commented Aug 28, 2018

/retest

@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 Aug 28, 2018
@liggitt
Copy link
Member Author

liggitt commented Aug 28, 2018

/milestone v1.12

@k8s-ci-robot k8s-ci-robot added this to the v1.12 milestone Aug 28, 2018
@divyenpatel
Copy link
Member

@liggitt

With 1.9 latest code base - v1.9.11-beta.0.15+65310cab62aa05, I see Hostname type address is already available for vsphere nodes.

"addresses": [
            {
                "address": "10.160.215.21",
                "type": "ExternalIP"
            },
            {
                "address": "10.160.215.21",
                "type": "InternalIP"
            },
            {
                "address": "kubernetes-node1",
                "type": "Hostname"
            }
        ],

I have checked vsphere cloud provider code on the master branch, I see no difference for the function func (vs *VSphere) NodeAddresses(nodeName k8stypes.NodeName) ([]v1.NodeAddress, error) { between two branch.

on the master branch build (v1.13.0-alpha.0.626+ed3c32c3f9af0e-dirty), I see only ExternalIP and InternalIP reported.

    "status": {
        "addresses": [
            {
                "address": "10.162.7.189",
                "type": "ExternalIP"
            },
            {
                "address": "10.162.7.189",
                "type": "InternalIP"
            }
        ],

Can you point to the code in kubernetes master branch which caused this regression?

@liggitt
Copy link
Member Author

liggitt commented Aug 28, 2018

See the description in #67714

Prior to 1.12, the addresses reported by the cloud provider were being augmented with the locally detected hostname by the kubelet. This is not desirable for cloud providers that need to verify reported addresses against metadata.

Moving hostname address reporting into the cloud provider implementation lets each one decide how it will determine the hostname address to report, and lets vsphere continue to report hostnames the way it did in previous releases

@liggitt
Copy link
Member Author

liggitt commented Aug 29, 2018

/retest

@divyenpatel
Copy link
Member

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: divyenpatel, liggitt

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 Aug 29, 2018
@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

@figo
Copy link
Contributor

figo commented Aug 29, 2018

@liggitt this issue failed test in cross-cloud CI and also a conformance tests CI for vSphere, crosscloudci/crosscloudci#65, i saw your pull while submitting a fix, thanks for the fix, my fix is the same, so i just create another pull request to submit the test part, #68017 thanks

figo added a commit to figo/kubernetes that referenced this pull request Aug 29, 2018
as in pull kubernetes#67922 has modify vsphere cloud provider to report
node hostname, this patch is to add the test for it.

also fix an issue at InstanceID(), it suppose to return
cloudprovider.InstanceNotFound when vm not found, after the fix,
test TestInstance() can pass
k8s-github-robot pushed a commit that referenced this pull request Sep 2, 2018
Automatic merge from submit-queue (batch tested with PRs 65566, 67959, 68029, 68017, 67263). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

add test to verify vsphere cloud provider report node hostname

**What this PR does / why we need it**:
as in pull #67922 has modify vsphere cloud provider to report
node hostname, this patch is to add the test for it.

also fix an issue at InstanceID(), it suppose to return
cloudprovider.InstanceNotFound when vm not found,  
but it did double error type translation with a retry() logic,  
after removing the retry() (which is not necessary), the logic is simpler, and easier to understand how double translation happened, after the fix,
test TestInstance() can pass


**Which issue(s) this PR fixes** :
Fixes #67714


**Special notes for your reviewer**:
as in the process of create pull to fix crosscloudci/crosscloudci#65,
i saw #67922 already merged, so this pull is just to submit the test part.

**Release note**:

```release-note
none
```


/cc @abrarshivani @BaluDontu @divyenpatel @imkin @kerneltime @luomiao @frapposelli @dougm @liggitt
/sig cloudprovider
@liggitt liggitt deleted the vsphere-hostname branch October 3, 2018 15:33
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. 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.

None yet

5 participants