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

KEP-4427: Relaxed DNS search validation: Initial draft #4428

Merged
merged 19 commits into from
Feb 7, 2024

Conversation

sethev
Copy link
Contributor

@sethev sethev commented Jan 22, 2024

  • One-line PR description: Initial draft of KEP for relaxed DNS search string validation
  • Other comments:

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 22, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @sethev!

It looks like this is your first PR to kubernetes/enhancements 🎉. 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/enhancements 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 22, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @sethev. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@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 Jan 22, 2024
@thockin thockin self-assigned this Jan 24, 2024
@thockin thockin changed the title KEP-4427: Initial draft KEP-4427: Relaxed DNS search validation: Initial draft Jan 24, 2024
@thockin
Copy link
Member

thockin commented Jan 27, 2024

KEP freeze is looming - ping me here when this is ready for re-review.

@sethev
Copy link
Contributor Author

sethev commented Jan 31, 2024

@thockin ready for re-review

Comment on lines +133 to +135
Allowing underscores in the search string allows integration with legacy workloads without allowing anyone to define
these names within Kubernetes. Since having underscores in a name creates other issues (such as inability to obtain a publicly trusted TLS certificate),
search strings seem like the only area where this is likely to occur.
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the updated text, the reason we want this specific change is not about "searching" vs "defining", it's about "hostnames in DNS" vs "non-hostnames in DNS". Theoretically, some future Kubernetes feature might result in CoreDNS creating SRV records based on Kubernetes API fields, and in that case, we might want to allow using underscores in those fields, right?

So the reason we want to change searches and we don't want to change anything else is because searches is (currently) the only API field whose value gets used for things related to non-hostname DNS data.

Copy link
Contributor Author

@sethev sethev Feb 1, 2024

Choose a reason for hiding this comment

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

Yes, i agree with that reasoning. If a future feature introduces that case, I could see having a discussion about whether allowing underscores there encourages good practices, since then the defining vs using distinction would come in (the RFC does point out that sticking to the hostname rules leads to fewer problems, which matches my experience as well).

sethev and others added 2 commits February 1, 2024 09:49
Co-authored-by: Dan Winship <danwinship@redhat.com>
Co-authored-by: Dan Winship <danwinship@redhat.com>
@sethev sethev requested a review from thockin February 1, 2024 15:58
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.

I'm LGTM on the feature, but the PRR and metadata sections need to be finished.

@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. lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 2, 2024
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 2, 2024
@sethev
Copy link
Contributor Author

sethev commented Feb 2, 2024

/retest

@sethev
Copy link
Contributor Author

sethev commented Feb 2, 2024

@@ -0,0 +1,3 @@
kep-number: 4427
alpha:
approver: "@thockin"
Copy link
Member

Choose a reason for hiding this comment

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

sorry, I am not PRR approver - @jpbetz @johnbelamaric @wojtek-t or @deads2k - can one of you serve? This one should be easy.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, go ahead and put my GitHub handle here and I'll review.

@thockin
Copy link
Member

thockin commented Feb 2, 2024

/lgtm

except PRR reviewer

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 2, 2024
Copy link
Contributor

@jpbetz jpbetz left a comment

Choose a reason for hiding this comment

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

Once integration test list is updated and my other minor comments are reviewed I'm happy to approve for PRR

###### Does enabling the feature change any default behavior?

No, there is no change to default behavior.
This is a change to validation.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: validation is behavior, so this is a yes, but we're ratcheting in a widening of validation, which is OK

Added validation will be covered by unit tests along with unit tests covering the behavior
when the gate is enabled or disabled.

##### Integration tests
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 where the most important tests should be written. The apiserver can be started in integration with feature flags set and we have confidence that those tests mirror what will happen in production. Let's list out the test cases we need to validate the ratcheting here:

  • feature gate on
  • feature gate off
  • feature gate on, name with_ written, feature gate off, updates still work that change other fields or that change name to something without _, (what if the name is changed to a new value with _?)
  • ...


###### How can someone using this feature know that it is working for their instance?

N/A. This is a validation change.
Copy link
Contributor

Choose a reason for hiding this comment

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

Very minor point here, but they could write a resource with _ and see that the write succeeds.

@danwinship
Copy link
Contributor

/hold cancel
lgtm too, just needs PRR updates

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 3, 2024
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 6, 2024
@sethev
Copy link
Contributor Author

sethev commented Feb 6, 2024

@jpbetz @danwinship @thockin updated integration test scenarios and corrected the PRR reviewer.

@danwinship
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 6, 2024

### Risks and Mitigations

The change is opt-in, since it requires configuring a search string with an underscore. So there is no risk beyond
Copy link
Member

Choose a reason for hiding this comment

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

any libc or muslc possible problems?

Copy link
Contributor Author

@sethev sethev Feb 6, 2024

Choose a reason for hiding this comment

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

Not beyond what already exists (which is that different implementations of libc may have different length restrictions for the total - all search string lengths added together). I checked glibc and muslc and they don't validate anything besides the length when parsing resolv.conf (same is true of golang's resolver).

@jpbetz
Copy link
Contributor

jpbetz commented Feb 7, 2024

/approve
For PRR for alpha (I see some beta PRR questions are also answered, we're review those when we promote to beta)

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jpbetz, sethev, 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 Feb 7, 2024
@k8s-ci-robot k8s-ci-robot merged commit 75497ab into kubernetes:master Feb 7, 2024
4 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.30 milestone Feb 7, 2024
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

8 participants