-
Notifications
You must be signed in to change notification settings - Fork 40.9k
KEP-4762: Allows setting any FQDN as the pod's hostname #132558
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
base: master
Are you sure you want to change the base?
Conversation
/sig network |
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
/test pull-kubernetes-node-e2e-containerd-alpha-features |
1 similar comment
/test pull-kubernetes-node-e2e-containerd-alpha-features |
you are missing one important part, pkg/api/pod/util.go needs to deal with the skewed problem where the feature was enablled and later roll back per example, see https://github.com/kubernetes/kubernetes/pull/91699/files#diff-40853a2fe474b6bde454934dc4e0742a3d9bbf98c31336d8d74520ebe8a2e300 for reference |
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 just focused on API stuff
allErrs = append(allErrs, field.Forbidden(fldPath.Child("hostnameOverride"), "when `pod.Spec.SetHostnameAsFQDN` is true")) | ||
} | ||
// If HostNetwork is true, HostnameOverride must not be set. | ||
if spec.SecurityContext != nil && spec.SecurityContext.HostNetwork { |
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 think it is better to disallow it now and if/when we implement hostNetwork + UTS, we can allow it. Better than allowing it and later changing the behavior.
/triage accepted |
df177ae
to
a7dedb0
Compare
a7dedb0
to
4aebea6
Compare
4aebea6
to
fa4b4e2
Compare
Need to move e2e tests from e2e_node to e2e/node - will do this later... |
fa4b4e2
to
6ec8e87
Compare
6ec8e87
to
94056b8
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: HirazawaUi The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@HirazawaUi: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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-sigs/prow repository. I understand the commands that are listed here. |
/retest |
Done. |
For the release note / change log entry, list the improvement first (and mention the feature gate later). |
What type of PR is this?
/kind feature
What this PR does / why we need it:
The
HostnameOverride
feature gate is scheduled for release-1.34. The associated KEP has been merged, and this PR implements the content of the KEP.ref: https://github.com/kubernetes/enhancements/tree/master/keps/sig-network/4762-allow-arbitrary-fqdn-as-pod-hostname .
Which issue(s) this PR is related to:
Special notes for your reviewer:
For this PR, we have added the following e2e tests:
podSpec.hostname
andpodSpec.hostnameOverride
fields, the pod hostname shall be the value ofpodSpec.hostnameOverride
.podSpec.hostnameOverride
field, the pod hostname shall be the value ofpodSpec.hostnameOverride
.podSpec.subdomain
andpodSpec.hostnameOverride
fields, the pod hostname shall be the value ofpodSpec.hostnameOverride
.podSpec.setHostnameAsFQDN
andpodSpec.hostnameOverride
fields, pod creation shall not be allowed.podSpec.hostNetwork
andpodSpec.hostnameOverride
fields, pod creation shall not be allowed.podSpec.hostnameOverride
, pod creation shall not be allowed.These cases sufficiently cover all entries related to the
podSpec.hostnameOverride
field mentioned in the table. Should additional test cases be required for other entries in the table, they should be addressed in a new PR, as they are unrelated to this Feature gate.Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: