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
Documentation for new feature setHostnameAsFQDN #21210
Conversation
Welcome @javidiaz! |
Deploy preview for kubernetes-io-vnext-staging processing. Building with commit 64422b1 https://app.netlify.com/sites/kubernetes-io-vnext-staging/deploys/5f04de5d7a024a0007e2545b |
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.
Hi. Here's some early feedback on this draft PR.
content/en/docs/concepts/services-networking/dns-pod-service.md
Outdated
Show resolved
Hide resolved
content/en/docs/concepts/services-networking/dns-pod-service.md
Outdated
Show resolved
Hide resolved
content/en/docs/concepts/services-networking/dns-pod-service.md
Outdated
Show resolved
Hide resolved
content/en/docs/reference/command-line-tools-reference/feature-gates.md
Outdated
Show resolved
Hide resolved
content/en/docs/reference/command-line-tools-reference/kube-apiserver.md
Outdated
Show resolved
Hide resolved
/milestone 1.19 |
@savitharaghunathan: You must be a member of the kubernetes/website-milestone-maintainers GitHub team to set the milestone. If you believe you should be able to issue the /milestone command, please contact your Website milestone maintainers and have them propose you as an additional delegate for this responsibility. In response to this:
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. |
Hi @sftim , when you get a moment can you add milestone label to this PR, please? |
/milestone 1.19 |
@savitharaghunathan @sftim Thanks for the feedback! I will work on fixing this. We were thinking to include an admission controller example (code and yaml files) and reference it from these docs. Where should I put those files? |
Hi @thockin, I was thinking to put the information about the HostnameFQDN feature in https://deploy-preview-21210--kubernetes-io-vnext-staging.netlify.app/docs/concepts/services-networking/dns-pod-service/#pod-hostnamefqdn-field That page is about networking concepts, but I think it is the only place in docs where Pod FQDN are discussed. Are you OK with adding this section to that page? do you have suggestions for a better location? |
/assign @xiangpengzhao |
content/en/docs/concepts/services-networking/dns-pod-service.md
Outdated
Show resolved
Hide resolved
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.
Markdown looks good to me.
@thockin @dchen1107 Could you please have a look at this doc PR? This is related to the SetHostnameAsFQDN feature kubernetes/kubernetes#91699 I think need a lgtm from one of you. thanks! |
{{< note >}} | ||
In Linux, the hostname field of the kernel (the `nodename` field of `struct utsname`) is limited to 64 characters. | ||
|
||
If a Pod enables this feature and its FQDN is longer than 64 character, it will fail to start. The Pod will remain in `Pending` status (`ContainerCreating` as seen by `kubectl`) generating error events regarding its FQDN length. One way of improving user experience for this scenario is to create an [admission webhook controller](/docs/reference/access-authn-authz/extensible-admission-controllers/#admission-webhooks) to control FQDN size when users create top level objects, for example, Deployment. |
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.
Is this page relevant:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names
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 am not sure we should link to that page, it might be confusing for users. That page is mentioning that some k8s objects follow the same regex as DNS for naming. In this page we are discussing networking concepts, which are not really k8s objects.
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 guess I found this phrase confusing:
If a Pod enables this feature and its FQDN is longer than 64 character,
I'll see if the KEPs add clarification.
OK. This makes sense.
/cc |
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.
one optional suggestion. lgtm otherwise
{{< note >}} | ||
In Linux, the hostname field of the kernel (the `nodename` field of `struct utsname`) is limited to 64 characters. | ||
|
||
If a Pod enables this feature and its FQDN is longer than 64 character, it will fail to start. The Pod will remain in `Pending` status (`ContainerCreating` as seen by `kubectl`) generating error events regarding its FQDN length. One way of improving user experience for this scenario is to create an [admission webhook controller](/docs/reference/access-authn-authz/extensible-admission-controllers/#admission-webhooks) to control FQDN size when users create top level objects, for example, Deployment. |
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.
It may be helpful to know the name of the failure event.
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.
Thanks @dashpole, good idea. I changed sentence to add example.
544442a
to
c9a4ed4
Compare
/lgtm |
@dashpole can you lgtm again please? I had to rebase. thanks! |
/lgtm |
Markdown looks good to me. |
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
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: savitharaghunathan 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 |
@@ -157,6 +157,18 @@ pointing to the Pod's IP address. Also, Pod needs to become ready in order to ha | |||
record unless `publishNotReadyAddresses=True` is set on the Service. | |||
{{< /note >}} | |||
|
|||
### Pod's setHostnameAsFQDN field {#pod-sethostnameasfqdn-field} | |||
|
|||
When a Pod is configured to have fully qualified domain name (FQDN), its hostname is the short hostname. For example, if you have a Pod with the fully qualified domain name `busybox-1.default-subdomain.my-namespace.svc.cluster-domain.example`, then by default the `hostname` command inside that Pod returns `busybox-1` and the `hostname --fqdn` command returns the FQDN. |
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 lacking an alpha notice.
{{< feature-state for_k8s_version="v1.19" state="alpha" >}}
A mention of the Feature gate would be useful too.
This change documents how to use a new feature introduced by KEP kubernetes/enhancements#1797 and kubernetes/enhancements#1792. The PR of the code change is kubernetes/kubernetes#91699