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

lowercase node name in generated static pod name #59849

Merged
merged 2 commits into from Feb 26, 2018

Conversation

@yue9944882
Member

yue9944882 commented Feb 14, 2018

What this PR does / why we need it:
Cast appended node name to lowercase when generating static pod name on kubelet starting.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #59801

Special notes for your reviewer:
Not sure about how to deal with other illegal node names e.g. containing invalid no-alphabetic characters. Maybe just let it fail-hard is not a bad idea.
But considering that containing uppercase letter in the hostname is somehow a usual case even in the production environment of some companies, tolerating uppercase and cast it implicitly should be good.

Release note:

force node name lowercase on static pod name generating
@yue9944882

This comment has been minimized.

Member

yue9944882 commented Feb 14, 2018

/assign @dchen1107

@yue9944882 yue9944882 changed the title from force node name in generated static pod name lowercase to lowercase node name in generated static pod name Feb 14, 2018

@gyliu513

This comment has been minimized.

Member

gyliu513 commented Feb 14, 2018

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the lgtm label Feb 14, 2018

@gyliu513

Just found that we do not have unit-test for this function, can you please add a unit test for this?

@errordeveloper

This comment has been minimized.

Member

errordeveloper commented Feb 14, 2018

/retest
/lgtm

@k8s-merge-robot k8s-merge-robot removed the lgtm label Feb 14, 2018

@yue9944882

This comment has been minimized.

Member

yue9944882 commented Feb 14, 2018

@errordeveloper I just made some stupid mistake in my previous submit. Plz take another look thx.

@yue9944882

This comment has been minimized.

Member

yue9944882 commented Feb 15, 2018

@gyliu513 WDYM?A unittest proving the node name is successfully lowercased?

@gyliu513

This comment has been minimized.

Member

gyliu513 commented Feb 16, 2018

@yue9944882 yes, add a new unit test case for the function that you updated

@k8s-ci-robot k8s-ci-robot added size/M and removed size/XS labels Feb 17, 2018

@yue9944882

This comment has been minimized.

Member

yue9944882 commented Feb 17, 2018

@gyliu513 PTAL thx😉

@k8s-ci-robot k8s-ci-robot added the lgtm label Feb 17, 2018

@yue9944882

This comment has been minimized.

Member

yue9944882 commented Feb 20, 2018

@yujuhong @tallclair @Random-Liu Do u think about approving this plz? thx

@tallclair

This comment has been minimized.

Member

tallclair commented Feb 20, 2018

This seems like it might be a deeper issue. If uppercase node names are allowed, what happens when you have 2 nodes with the same name but different capitalization?

@yue9944882

This comment has been minimized.

Member

yue9944882 commented Feb 20, 2018

This seems like it might be a deeper issue. If uppercase node names are allowed, what happens when you have 2 nodes with the same name but different capitalization?

@tallclair I think either one of static pods will fail to be created due to pod name conflict. How do you think about adding random suffix to the static pod name?

nodeName := types.NodeName(hostname)

Actually uppercase node name is allowed currently. Solving this issue might be simple as "allow" or "not allow". For former case, we should provide full support for uppercase node name, or rather, making sure every static pod created successfully. OTOH, we should make kubelet with uppercase node name fail-hard before it joining the cluster. WYDT?

@gyliu513

This comment has been minimized.

Member

gyliu513 commented Feb 22, 2018

I prefer that we keep current logic of lower case the host name directly as it is not good to have two same host name in one cluster but different capitalization, please take a look at calico, it is already coverting all host name to lowercase automatically projectcalico/calico#1441 (comment) , comments @yue9944882 @tallclair

@dchen1107

This comment has been minimized.

Member

dchen1107 commented Feb 24, 2018

I am ok with current logic, but want to make sure the cause described at #59849 (comment) has a explicit error for one of failing static pod. @yue9944882 can you add another tests with two nodes with same name but different capitalization?

/approve

@dchen1107 dchen1107 removed the lgtm label Feb 24, 2018

@dchen1107

This comment has been minimized.

Member

dchen1107 commented Feb 24, 2018

I approved this pr, but cancelled lgtm. Once you addressed my comment, please feel free to re-apply lgtm. Thanks!

@yue9944882

This comment has been minimized.

Member

yue9944882 commented Feb 25, 2018

@dchen1107 ACK, test added.

@yue9944882

This comment has been minimized.

Member

yue9944882 commented Feb 25, 2018

/test pull-kubernetes-unit

@k8s-ci-robot k8s-ci-robot added the lgtm label Feb 26, 2018

@k8s-ci-robot

This comment has been minimized.

Contributor

k8s-ci-robot commented Feb 26, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dchen1107, errordeveloper, gyliu513, yue9944882

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-merge-robot

This comment has been minimized.

Contributor

k8s-merge-robot commented Feb 26, 2018

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

@k8s-merge-robot

This comment has been minimized.

Contributor

k8s-merge-robot commented Feb 26, 2018

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-merge-robot k8s-merge-robot merged commit 52b7aab into kubernetes:master Feb 26, 2018

12 of 13 checks passed

Submit Queue Required Github CI test is not green: pull-kubernetes-e2e-gce
Details
cla/linuxfoundation yue9944882 authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gke Skipped
pull-kubernetes-e2e-kops-aws Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce Job succeeded.
Details
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-unit Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment