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
kubeadm: perform a host name check on init / join #99194
kubeadm: perform a host name check on init / join #99194
Conversation
|
||
if len(hc.nodeName) > 63 { | ||
warnings = append(warnings, errors.Errorf("hostname \"%s\" should be no more than 63 characters. Change hostname or use --node-name flag to override it", hc.nodeName)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would like to understand more about the kubelet requirements before applying such a change.
#99156
aren't we supposed to use IsQualifiedName() instead of pining to 63?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is closed, until further notice.
does the kubelet actually impose validation and limitation to the hostnames the user can pass to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kubelet doesn't validate it, but hostname is used in some other features like node-label selector and static-pod suffix.
If it is too long, something may not work. So I think we should add a warning here.
As this is not strictly limited, it is not an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true, we are adding a warning here in kubeadm and that's fine, but i'm wondering about a few things when a Node name is too long:
- does the bootstrap finish OK (i.e. node joins the cluster)?
- can pods still schedule on this node?
i guess i can try some of these things myself..
i'm asking because maybe the kubelet should also error out on long names (separate PR).
but if some of that partially works such a change in the kubelet would need an "action required" because otherwise it will break some users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add to my todo list on kubelet/sig-node
cb3b4a3
to
2f6a3e8
Compare
Updated PR with |
2f6a3e8
to
df3428d
Compare
Co-authored-by: Lubomir I. Ivanov <neolit123@gmail.com>
2788413
to
2c89fa4
Compare
/retest |
/test pull-kubernetes-e2e-kind |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/triage accepted
/approve
/priority backlog
this seems fine to me.
this check will be run on both init and join. so we should change the release note to:
kubeadm: during "init" and "join" perform preflight validation on the host / node name and throw warnings if a name is not compliant
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: neolit123, pacoxu 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 |
/retitle kubeadm: perform a host name check on init / join |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/retest |
/retest |
/retest Review the full test history for this PR. Silence the bot with an |
/retest |
/retest |
What type of PR is this?
/kind feature
small enhancement
What this PR does / why we need it:
#99156 (comment)
Which issue(s) this PR fixes:
Make it clear during
kubeadm join
. User may encounter an issue like #99156.Longer node name may lead to label adding problem and so on.
Special notes for your reviewer:
The host name will be used as the machine name and will be used as the DNS suffix, so the host name must meet the hostname specification defined by RFC 1123. Hostname should be less than 63 characters and satisfy regular expression
^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: