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

Documentation for new feature setHostnameAsFQDN #21210

Merged
merged 1 commit into from Jul 8, 2020

Conversation

javidiaz
Copy link
Contributor

@javidiaz javidiaz commented May 26, 2020

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

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 26, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @javidiaz!

It looks like this is your first PR to kubernetes/website 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/website has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 26, 2020
@k8sio-netlify-preview-bot
Copy link
Collaborator

Deploy preview for kubernetes-io-vnext-staging processing.

Building with commit 64422b1

https://app.netlify.com/sites/kubernetes-io-vnext-staging/deploys/5f04de5d7a024a0007e2545b

@k8s-ci-robot k8s-ci-robot added language/en Issues or PRs related to English language sig/docs Categorizes an issue or PR as relevant to SIG Docs. labels May 26, 2020
Copy link
Contributor

@sftim sftim left a 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.

@savitharaghunathan
Copy link
Member

/milestone 1.19

@k8s-ci-robot
Copy link
Contributor

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

/milestone 1.19

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.

@savitharaghunathan
Copy link
Member

/milestone 1.19

Hi @sftim , when you get a moment can you add milestone label to this PR, please?

@savitharaghunathan
Copy link
Member

/milestone 1.19

@k8s-ci-robot k8s-ci-robot added this to the 1.19 milestone May 27, 2020
@javidiaz
Copy link
Contributor Author

javidiaz commented Jun 2, 2020

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

@javidiaz
Copy link
Contributor Author

javidiaz commented Jun 2, 2020

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?

@javidiaz
Copy link
Contributor Author

/assign @xiangpengzhao

@javidiaz javidiaz changed the title [WIP] Documentation for new feature hostnameFQDN Documentation for new feature setHostnameAsFQDN Jun 19, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 19, 2020
Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

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

Preview

Markdown looks good to me.

@javidiaz
Copy link
Contributor Author

@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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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.

Copy link
Contributor

@kbhawkey kbhawkey Jun 30, 2020

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.

@dashpole
Copy link
Contributor

/cc

Copy link
Contributor

@dashpole dashpole left a 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.
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@javidiaz javidiaz force-pushed the hostnamefqdn branch 3 times, most recently from 544442a to c9a4ed4 Compare July 7, 2020 15:58
@dashpole
Copy link
Contributor

dashpole commented Jul 7, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 7, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 7, 2020
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 7, 2020
@javidiaz
Copy link
Contributor Author

javidiaz commented Jul 7, 2020

@dashpole can you lgtm again please? I had to rebase. thanks!

@dashpole
Copy link
Contributor

dashpole commented Jul 7, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 7, 2020
@sftim
Copy link
Contributor

sftim commented Jul 8, 2020

Preview

Markdown looks good to me.

Copy link
Member

@savitharaghunathan savitharaghunathan left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[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 /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 Jul 8, 2020
@k8s-ci-robot k8s-ci-robot merged commit 38a5d01 into kubernetes:dev-1.19 Jul 8, 2020
@@ -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.
Copy link
Member

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.

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. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants