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

Adds nodelocaldns_additional_configs to facilitate additional CoreDNS config options #11657

Merged

Conversation

0x4c6565
Copy link
Contributor

@0x4c6565 0x4c6565 commented Oct 22, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds an extra variable nodelocaldns_additional_configs to allow additional config to be added to the node-local DNS CoreDNS config, just as can be done with normal CoreDNS config with variable coredns_additional_configs

Which issue(s) this PR fixes:

N/A

Special notes for your reviewer:

Could we simply reuse the existing variable coredns_additional_configs here instead of adding a new variable?

Does this PR introduce a user-facing change?:

Adds `nodelocaldns_additional_configs` variable

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. 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. labels Oct 22, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @0x4c6565. 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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 22, 2024
@yankay
Copy link
Member

yankay commented Oct 24, 2024

/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 Oct 24, 2024
@yankay
Copy link
Member

yankay commented Oct 25, 2024

Thanks @0x4c6565
/approve

@cyclinder would you please help to review it .

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 0x4c6565, 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 Oct 25, 2024
Copy link
Contributor

@cyclinder cyclinder left a comment

Choose a reason for hiding this comment

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

Hi @0x4c6565, thanks for the contribution!

@@ -55,6 +55,11 @@ nodelocaldns_ds_nodeselector: "kubernetes.io/os: linux"
nodelocaldns_prometheus_port: 9253
nodelocaldns_secondary_prometheus_port: 9255

# nodelocaldns_additional_configs adds any extra configuration to coredns
# nodelocaldns_additional_configs: |
# whoami
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

@0x4c6565 0x4c6565 Nov 7, 2024

Choose a reason for hiding this comment

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

For my particular use case, I wish to use the template plugin to respond to a query, so that this can be rewritten to a k8s service address via CNAME. I'm unable to utilise the existing coredns_additional_configs variable for this as this isn't used in the nodelocal dns config template, only in the coredns config template, and queries for non-k8s service addresses are passed directly to upstream from nodelocal dns

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, thanks for the explanation.

@@ -75,6 +75,9 @@ data:
prometheus {% if nodelocaldns_bind_metrics_host_ip %}{$MY_HOST_IP}{% endif %}:{{ nodelocaldns_prometheus_port }}
}
.:53 {
{% if nodelocaldns_additional_configs is defined %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should in-addr.arpa:53 and ip6.arpa:53 require these configs if we need these configs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It depends on the intended use of this variable I suppose. I kept this consistent with coredns_additional_configs:

.:53 {
{% if coredns_additional_configs is defined %}
{{ coredns_additional_configs | indent(width=8, first=False) }}
{% endif %}

@cyclinder
Copy link
Contributor

/lgtm

/cc @yankay Could you please approval this?

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 8, 2024
@k8s-ci-robot k8s-ci-robot merged commit aa76e39 into kubernetes-sigs:master Nov 8, 2024
40 checks passed
kpoxo6op pushed a commit to kpoxo6op/kubespray that referenced this pull request Dec 27, 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/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. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

4 participants