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 node DNS info with --node-ip #63170

Merged
merged 1 commit into from
May 11, 2018

Conversation

micahhausler
Copy link
Member

@micahhausler micahhausler commented Apr 25, 2018

What this PR does / why we need it:
This PR adds ExternalDNS, InternalDNS, and ExternalIP info for kubelets with the --nodeip flag enabled.

Which issue(s) this PR fixes
Fixes #63158

Special notes for your reviewer:

I added a field to the Kubelet to make IP validation more testable (validateNodeIP relies on the net package and the IP address of the host that is executing the test.) I also converted the test to use a table so new cases could be added more easily.

Release Notes

Report node DNS info with --node-ip flag

@andrewsykim
@nckturner

/sig node
/sig network

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 25, 2018
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/network Categorizes an issue or PR as relevant to SIG Network. labels Apr 25, 2018
@micahhausler micahhausler force-pushed the node-ip-fix branch 4 times, most recently from f9b6f84 to 5446e2b Compare April 25, 2018 22:43
@andrewsykim
Copy link
Member

andrewsykim commented Apr 26, 2018

Thanks for the PR @micahhausler! There's some assumptions from nodecontroller that also overrides node addresses when kubelet sets --node-ip and --cloud-provider=external (https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/cloud/node_controller.go#L181-L189). I think removing this should fix it.

@andrewsykim
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 26, 2018
@micahhausler micahhausler force-pushed the node-ip-fix branch 2 times, most recently from 431e83a to 2bdb719 Compare April 27, 2018 19:01
@micahhausler
Copy link
Member Author

@andrewsykim Done!

glog.Errorf("Specified Node IP not found in cloudprovider")
return
}
nodeAddresses = []v1.NodeAddress{*nodeIP}
Copy link
Member

Choose a reason for hiding this comment

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

sorry I wasn't clear earlier. I think we should still validate that nodeIP suggested by user exists, but we don't need to override the entire slice here with

nodeAddresses = []v1.NodeAddress{*nodeIP}

Copy link
Member

Choose a reason for hiding this comment

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

You can probably just port the changes from #63101

Copy link
Member Author

Choose a reason for hiding this comment

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

got it

```release-note
Report node DNS info with --node-ip flag
```
@micahhausler
Copy link
Member Author

/test pull-kubernetes-e2e-gce

@andrewsykim
Copy link
Member

/lgtm

@kubernetes/sig-node-pr-reviews PTAL

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 28, 2018
@bowei
Copy link
Member

bowei commented May 1, 2018

/assign @yujuhong looks like a kubelet change

Copy link
Contributor

@nckturner nckturner left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -521,6 +521,7 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
containerManager: kubeDeps.ContainerManager,
containerRuntimeName: containerRuntime,
nodeIP: parsedNodeIP,
nodeIPValidator: validateNodeIP,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is a pretty clean way of allowing validateNodeIP() to be mocked for testing. The alternative I can think of is to create a kubelet wrapper for net.InterfaceAddrs() to allow you test get testing coverage for the validateNodeIP() function itself.

@micahhausler
Copy link
Member Author

/test pull-kubernetes-verify
/test pull-kubernetes-e2e-gce

@micahhausler
Copy link
Member Author

/test pull-kubernetes-e2e-gce

4 similar comments
@micahhausler
Copy link
Member Author

/test pull-kubernetes-e2e-gce

@micahhausler
Copy link
Member Author

/test pull-kubernetes-e2e-gce

@micahhausler
Copy link
Member Author

/test pull-kubernetes-e2e-gce

@micahhausler
Copy link
Member Author

/test pull-kubernetes-e2e-gce

@micahhausler
Copy link
Member Author

/test pull-kubernetes-local-e2e-containerized

@micahhausler
Copy link
Member Author

@bowei Can you PTAL? Thanks!

@jagosan
Copy link
Contributor

jagosan commented May 11, 2018

@yujuhong - bumping this as I think bowei is ooo for a couple of days. Can you take a look at this?

@dchen1107
Copy link
Member

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewsykim, dchen1107, micahhausler

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

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

@micahhausler
Copy link
Member Author

/milestone v1.10

@k8s-ci-robot
Copy link
Contributor

@micahhausler: You must be a member of the kubernetes-milestone-maintainers github team to set the milestone.

In response to this:

/milestone v1.10

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.

@micahhausler
Copy link
Member Author

@dchen1107 Can you add this to 1.10 so it can get backported?

@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.

@k8s-github-robot k8s-github-robot merged commit 6017f6d into kubernetes:master May 11, 2018
k8s-github-robot pushed a commit that referenced this pull request Aug 1, 2018
…#63170-upstream-release-1.10

Automatic merge from submit-queue.

Automated cherry pick of #63170: Report node DNS info with --node-ip

Cherry pick of #63170 on release-1.10.

#63170: Report node DNS info with --node-ip
@micahhausler micahhausler deleted the node-ip-fix branch January 21, 2019 17:38
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 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. sig/node Categorizes an issue or PR as relevant to SIG Node. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kubelet doesn't report ExternalIP/DNS with --node-ip
8 participants