Skip to content

KEP-4762: Allows setting any FQDN as the pod's hostname #4768

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

Merged
merged 3 commits into from
Jun 17, 2025

Conversation

HirazawaUi
Copy link
Contributor

  • One-line PR description: Allows users to set any FQDN as the hostname of a pod
  • Other comments:

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 18, 2024
@k8s-ci-robot k8s-ci-robot added kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/network Categorizes an issue or PR as relevant to SIG Network. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 18, 2024
@HirazawaUi HirazawaUi force-pushed the overwrite-pod-hostname branch 3 times, most recently from 8728dcf to d935541 Compare July 21, 2024 13:35
@HirazawaUi
Copy link
Contributor Author

/cc @thockin

@HirazawaUi HirazawaUi force-pushed the overwrite-pod-hostname branch 2 times, most recently from 9daccf9 to 18d6ffd Compare July 27, 2024 15:49
@HirazawaUi HirazawaUi force-pushed the overwrite-pod-hostname branch 3 times, most recently from 12dc314 to f2c3e30 Compare October 21, 2024 13:01
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 19, 2025
@HirazawaUi
Copy link
Contributor Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 20, 2025
@HirazawaUi
Copy link
Contributor Author

ping @thockin

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@HirazawaUi HirazawaUi force-pushed the overwrite-pod-hostname branch from 2d4d3e4 to e8e81d6 Compare June 9, 2025 15:34
Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

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

LGTM from API
/approve

Comment on lines 208 to 215
| Behavior | result for `hostname` | result for `hostname -f` | DNS Record |
| ------------------------------------------------------------ | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
| hostname: busybox1 | busybox1 | busybox1 | None |
| hostname: busybox1<br />subdomain: busybox-subdomain | busybox1 | busybox1.busybox-subdomain.default.svc.cluster.local | busybox1.busybox-subdomain.default.svc.cluster.local |
| hostname: busybox1<br />subdomain: busybox-subdomain<br />setHostnameAsFQDN: true | busybox1.busybox-subdomain.default.svc.cluster.local | busybox1.busybox-subdomain.default.svc.cluster.local | busybox1.busybox-subdomain.default.svc.cluster.local |
| hostnameOverride: www.example.com | www.example.com | www.example.com | None |
| hostname: busybox1<br />hostnameOverride: www.example.com | www.example.com | www.example.com | None |
| hostname: busybox1<br />hostnameOverride: www.example.com<br />subdomain: busybox-subdomain | www.example.com | www.example.com | busybox1.busybox-subdomain.default.svc.cluster.local |
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
| Behavior | result for `hostname` | result for `hostname -f` | DNS Record |
| ------------------------------------------------------------ | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
| hostname: busybox1 | busybox1 | busybox1 | None |
| hostname: busybox1<br />subdomain: busybox-subdomain | busybox1 | busybox1.busybox-subdomain.default.svc.cluster.local | busybox1.busybox-subdomain.default.svc.cluster.local |
| hostname: busybox1<br />subdomain: busybox-subdomain<br />setHostnameAsFQDN: true | busybox1.busybox-subdomain.default.svc.cluster.local | busybox1.busybox-subdomain.default.svc.cluster.local | busybox1.busybox-subdomain.default.svc.cluster.local |
| hostnameOverride: www.example.com | www.example.com | www.example.com | None |
| hostname: busybox1<br />hostnameOverride: www.example.com | www.example.com | www.example.com | None |
| hostname: busybox1<br />hostnameOverride: www.example.com<br />subdomain: busybox-subdomain | www.example.com | www.example.com | busybox1.busybox-subdomain.default.svc.cluster.local |
| # | `.hostname` | `.subdomain` | `.setHostnameAsFQDN` | `.hostnameOverride` | `$(hostname)` | `$(hostname -f)` | DNS (assuming service exists) |
| -- | ----------- | ------------ | -------------------- | ------------------- | ------------------------------ | ------------------------------ | ------------------------------ |
| 0 | | | | | `<podname>` | `<podname>` | |
| 1 | `aa` | | | | `aa` | `aa` | |
| 2 | | `bb` | | | `<podname>` | `<podname>.bb.<ns>.svc.<zone>` | `<podname>.bb.<ns>.svc.<zone>` |
| 3 | `aa` | `bb` | | | `aa` | `aa.bb.<ns>.svc.<zone>` | `aa.bb.<ns>.svc.<zone>` |
| 4 | | | true | | `<podname>` | `<podname>` | |
| 5 | `aa` | | true | | `aa` | `aa` | |
| 6 | | `bb` | true | | `<podname>.bb.<ns>.svc.<zone>` | `<podname>.bb.<ns>.svc.<zone>` | `<podname>.bb.<ns>.svc.<zone>` |
| 7 | `aa` | `bb` | true | | `aa.bb.<ns>.svc.<zone>` | `aa.bb.<ns>.svc.<zone>` | `aa.bb.<ns>.svc.<zone>` |
| 8 | | | | `xx.yy.zz` | `xx.yy.zz` | `xx.yy.zz` | |
| 9 | `aa` | | | `xx.yy.zz` | `xx.yy.zz` | `xx.yy.zz` | |
| 10 | | `bb` | | `xx.yy.zz` | `xx.yy.zz` | `xx.yy.zz` | `<podname>.bb.<ns>.svc.<zone>` |
| 11 | `aa` | `bb` | | `xx.yy.zz` | `xx.yy.zz` | `xx.yy.zz` | `aa.bb.<ns>.svc.<zone>` |
| 12 | | | true | `xx.yy.zz` | INVALID | INVALID | INVALID |
| 13 | `aa` | | true | `xx.yy.zz` | INVALID | INVALID | INVALID |
| 14 | | `bb` | true | `xx.yy.zz` | INVALID | INVALID | INVALID |
| 15 | `aa` | `bb` | true | `xx.yy.zz` | INVALID | INVALID | INVALID |

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you very much for providing this table. I had promised to improve it over the weekend, but got caught up with other matters. Anyway, thank you very much.

Copy link
Member

@thockin thockin Jun 9, 2025

Choose a reason for hiding this comment

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

I didn't want to lose track of it, and I think it should probably go into the k8s docs in some nicer form :)

@lmktfy

@HirazawaUi HirazawaUi force-pushed the overwrite-pod-hostname branch from d2e0df4 to a06df4f Compare June 9, 2025 16:49
Copy link
Member

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

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

lgtm, except I suggest this be tested with the Conformance tests. Maybe add it also to graduation criteria

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Jun 9, 2025
Co-authored-by: Tim Hockin <thockin@google.com>
@HirazawaUi HirazawaUi force-pushed the overwrite-pod-hostname branch from a06df4f to 28de557 Compare June 10, 2025 15:51
@thockin
Copy link
Member

thockin commented Jun 10, 2025

Thanks!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 10, 2025
@thockin
Copy link
Member

thockin commented Jun 11, 2025

For viz: Joe is OOO this week - can @deads2k or @soltysh take this one?

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

Left several comments.


###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?

N/A
Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine for alpha, but you'll need to perform manual tests for beta promotion.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 13, 2025
@HirazawaUi HirazawaUi force-pushed the overwrite-pod-hostname branch from dcda75c to 28e9e15 Compare June 13, 2025 14:40
@HirazawaUi
Copy link
Contributor Author

@soltysh Thank you so much for taking the time with this KEP! I've addressed all the PRR comments, could you please take another look?

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/approve
the PRR

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: HirazawaUi, soltysh, thockin

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 Jun 17, 2025
@soltysh
Copy link
Contributor

soltysh commented Jun 17, 2025

lgtm, except I suggest this be tested with the Conformance tests. Maybe add it also to graduation criteria

Thanks!

/lgtm /approve

Since this was already tagged by Sergey and Tim, I'll go ahead and re-apply it

/lgtm
/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jun 17, 2025
@k8s-ci-robot k8s-ci-robot merged commit 9f7f291 into kubernetes:master Jun 17, 2025
4 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.34 milestone Jun 17, 2025
@HirazawaUi
Copy link
Contributor Author

Great to see this PR merged! Truly appreciate everyone's patient reviews and assistance.

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. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/network Categorizes an issue or PR as relevant to SIG Network. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants