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
OpenStack cloud provider should register with instance id instead of instance name #57765
Comments
/sig openstack |
- the BOSH director needs to have `human_readable_vm_names` set to false in order for the kubelet to register with the apiserver successfully See k8s issue: kubernetes/kubernetes#57765 [#153816342]
/assign I prefer to conform hostname to DNS-1123 subdomain spec. Already submitted a PR #57816 on this. |
I think the issue may be more than just the hostname. The hostname on my vm is set to
Since the OpenStack cloud provider uses the instance name to register with the api server, I also get error messages like the following:
It seems like for OpenStack specifically, it sets it's node name to the name returned from the OpenStack metadata server (https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/providers/openstack/openstack_instances.go#L61) which is not restricted to being DNS-1123 compliant. |
@bsnchan The node name must match ([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9], not contain '/'. |
I can confirm that Openstack can boot up instances with the name like
Agree. +1. @FengyunPan @bsnchan I've added an extra check in PR #57816. PTAL. Thanks. |
I think the question here is: Why did you choose to use Other possibilities for the nodename are:
What do you think about changing the source for selecting the nodename? |
cc @dims |
Automatic merge from submit-queue (batch tested with PRs 57867, 58490, 58502, 58134). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Openstack: register metadata.hostname as node name **What this PR does / why we need it**: Currently Openstack can boot up instances with the name like `xyz/abc`, which is not a valid kubelet node name. While `hostname` retrieved from `meta_data.json` has already been sanitized by Openstack to valid DNS-1123 format string. It's safe to register this `metadata.hostname` as valid kubelet node name. /kind bug /sig openstack **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 #57765 **Special notes for your reviewer**: /assign @dims @FengyunPan **Release note**: ```release-note Openstack: register metadata.hostname as node name ```
…stname Automatic merge from submit-queue (batch tested with PRs 57867, 58490, 58502, 58134). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Openstack: register metadata.hostname as node name **What this PR does / why we need it**: Currently Openstack can boot up instances with the name like `xyz/abc`, which is not a valid kubelet node name. While `hostname` retrieved from `meta_data.json` has already been sanitized by Openstack to valid DNS-1123 format string. It's safe to register this `metadata.hostname` as valid kubelet node name. /kind bug /sig openstack **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 kubernetes#57765 **Special notes for your reviewer**: /assign @dims @FengyunPan **Release note**: ```release-note Openstack: register metadata.hostname as node name ```
Once upon a time, the cloud provider's (only!) role was to discover a dynamic list of nodes by regex. In that world, using the nodename made perfect sense because the admin could then configure it to be something like Fast forward a few years, and this style of node registration is long gone, and there is no need to make the node name human readable, and in fact numerous reasons to choose other unique identifiers. There is still resistance to removing "human-friendly" node names, however. In the end, I didn't see a good alternative that would please everyone (and meet the required technical character set/length constraints). I stuck with metadata.name because at least it was under the control of the cluster admin, and so it could be obviously contrived to match our imposed k8s node name == openstack instance name constraint (once that constraint was communicated). |
Is this a BUG REPORT or FEATURE REQUEST?:
/kind bug
What happened:
The OpenStack cloud provider currently uses the name of the kubelet node to register with the API server. However the name is not guaranteed to conform to the DNS-1123 subdomain spec.
Given a node name of
worker/925f11f3-80af-4844-a00e-f0af521779d1
, the following message appears in the kubelet logs:What you expected to happen:
The OpenStack Cloud provider uses the instance id instead of the instance name. This will guarantee that the id conforms the DNS-1123 spec without making any assumptions on what the instance name may be.
How to reproduce it (as minimally and precisely as possible):
In the OpenStack console, rename a kubelet node to
kubelet/1234
and attempt to register the kubelet node to the api server.Anything else we need to know?:
Environment: OpenStack Newton
kubectl version
):uname -a
): Linux b4fdd4bc-cab9-44ff-9c99-44e91ff5b414 4.4.0-103-generic Suggest people verify they can start a VM on GCE. #126~14.04.1-Ubuntu SMP Mon Dec 4 19:33:04 UTC 2017 x86_64 x86_64 x86_64 GNU/LinuxThe text was updated successfully, but these errors were encountered: