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

Allow the DNS stack to be backward compatible with an old dns_domain #10630

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

VannTen
Copy link
Contributor

@VannTen VannTen commented Nov 20, 2023

What type of PR is this?
/kind feature

What this PR does / why we need it:

All domains in old_dns_domains are handled by nodelocaldns in the same server block
as the current dns_domain, while coredns performs a suffix rewrite of
each of the old dns domains to the current one.

This facilitates changing your dns_domain, for whatever reason, especially if some of your users/workloads embed the cluster dns_domain in their config.
(they should'nt, but they will)

Does this PR introduce a user-facing change?:

The variable `old_dns_domains` (list) can be used for backward compatibility when changing `dns_domain`

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 20, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @VannTen. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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 the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 20, 2023
@VannTen
Copy link
Contributor Author

VannTen commented Nov 20, 2023

/retest
Look like the runner are in trouble.

@k8s-ci-robot
Copy link
Contributor

@VannTen: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@yankay
Copy link
Member

yankay commented Nov 21, 2023

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 21, 2023
@VannTen
Copy link
Contributor Author

VannTen commented Nov 21, 2023

/retest

@VannTen
Copy link
Contributor Author

VannTen commented Nov 21, 2023

Looks like /retest does not work. Not sure if it's prow not picking it up or the CI in disarray. @floryut not sure if you can re-trigger it ?

@yankay
Copy link
Member

yankay commented Nov 23, 2023

Looks like /retest does not work. Not sure if it's prow not picking it up or the CI in disarray. @floryut not sure if you can re-trigger it ?

Thanks @VannTen

The CI has been repaired, would you please repush it to trige the CI agiain :-)

Handle all old dns domains:
- for nodelocaldns: in the same server block as the current dns_domain
- for coredns: uffix rewrite of each of the old dns domains to the
  current one
@VannTen
Copy link
Contributor Author

VannTen commented Dec 4, 2023

By the way, I tried to use #10045 before doing this, but it does not work with nodelocaldns, because dns queries outside of the cluster dns_domain are routed to upstream nameservers, and so never reach Coredns to be rewritten (also, the rewrite_block is not actually the block, since you need to manually specifiy rewrite and could instead put any plugin configuration here...

@VannTen
Copy link
Contributor Author

VannTen commented Dec 18, 2023

@cristicalin @liupeng0518 Any idea when you'll get a chance to look at this ?

@VannTen
Copy link
Contributor Author

VannTen commented Jan 22, 2024

/cc @MrFreezeex @mzaian
/uncc @cristicalin @liupeng0518

@k8s-ci-robot k8s-ci-robot requested review from MrFreezeex and mzaian and removed request for cristicalin and liupeng0518 January 22, 2024 15:39
Copy link
Member

@MrFreezeex MrFreezeex left a comment

Choose a reason for hiding this comment

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

Ohh that's pretty nice, I think this use case come somewhat pretty often so 👍
/lgtm

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

VannTen commented Jan 23, 2024

/assign @yankay @floryut
(approval)

@@ -49,6 +49,9 @@ data:
{% if coredns_rewrite_block is defined %}
{{ coredns_rewrite_block | indent(width=8, first=False) }}
{% endif %}
{% for old_dns_domain in old_dns_domains %}
rewrite name suffix {{ old_dns_domain }} {{ dns_domain }} answer auto
{% endfor %}
ready
kubernetes {{ dns_domain }} {% if coredns_kubernetes_extra_domains is defined %}{{ coredns_kubernetes_extra_domains }} {% endif %}{% if enable_coredns_reverse_dns_lookups %}in-addr.arpa ip6.arpa {% endif %}{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hum.
Looking at that just now I wonder if I should instead extend coredns_kubernetes_extra_domains (I don't think that setting can work currently since nodelocaldns won't forward it to coredns)

@yankay
Copy link
Member

yankay commented Jan 24, 2024

Thanks @VannTen
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MrFreezeex, VannTen, yankay

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 Jan 24, 2024
@k8s-ci-robot k8s-ci-robot merged commit c80f2cd into kubernetes-sigs:master Jan 24, 2024
63 checks passed
@mzaian mzaian mentioned this pull request Apr 26, 2024
pedro-peter pushed a commit to pedro-peter/kubespray that referenced this pull request May 8, 2024
…ubernetes-sigs#10630)

Handle all old dns domains:
- for nodelocaldns: in the same server block as the current dns_domain
- for coredns: uffix rewrite of each of the old dns domains to the
  current one
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/feature Categorizes issue or PR as related to a new feature. 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. 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.

5 participants