-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[Feature] Customizing CoreDNS ConfigMap with overrides and additional servers #4397
Conversation
1a0763a
to
35c5b7e
Compare
35c5b7e
to
793107e
Compare
793107e
to
ff7474a
Compare
Problem: Before, to customize CoreDNS, one had to edit the default configmap, which gets re-written on every K3s server restart. Solution: Mount an additional coredns-custom configmap into the CoreDNS container and import overrides and additional server blocks from the included files. Signed-off-by: Thorsten Klein <iwilltry42@gmail.com>
ff7474a
to
9bda03a
Compare
Rebased upon |
@iwilltry42 would you like to backport to 1.22? |
Merging this PR appears to have broken master |
This PR describes support for
However, upon testing, this functionality does not appear to be present and the code only contains an |
@chris13524 as per this thread, the PR was reduced to a single import of |
Could someone backport this feature to 1.21? since 1.22 removed a lot of old APIs, some of our server have to stay at 1.21. |
Hi @iwilltry42 I need to add a simple rewrite rule before the kubernetes plugin, like this one in my Corefile
I guess coredns-custom is the right tool for the task. So I started extending your example:
dig test.org shows the whoami plugin is invoked and a log entry is written by coredns I would have expected multiple import statements in the coredns main config map, however only the .end (I guess?) is present
I thought *.override.start was the right "hook" but if I put a rewrite using *.override.start nothing happens (CoreDNS correcly reloads the custom map) Am I missing something? thanks a lot |
Hi @ffatghub , please see #4397 (comment) |
Should this support wildcards? Not working for me in
In
|
INFO: As per #4397 (comment), the PR was reduced to a single import of *.server overrides
Proposed Changes
Feature: Add CoreDNS Customization Options
Problem:
Before, to customize CoreDNS, one had to edit the default configmap,
which gets re-written on every K3s server restart.
Solution:
Mount an additional coredns-custom configmap into the CoreDNS container
and import overrides and additional server blocks from the included
files.
Types of Changes
New Feature (non-breaking change).
Verification
coredns-custom
with some modifications, e.g. an additional server:[INFO] 10.42.0.11:52119 - 9047 "A IN example.org. udp 40 false 4096" NOERROR qr,aa,rd 91 0.00010936s
Linked Issues
User-Facing Change
Further Comments
Contents of the
coredns-custom
configmap can include the following keys:*.server
: defines a new server block*.override.start
: defines a configuration override that will be imported at the start of the originalCorefile
(i.e. just before thekubernetes
plugin)*.override.fallthrough
: defines a configuration override that will be imported at in the middle of the originalCorefile
to define fallthrough actions (i.e. just after consulting theNodeHosts
hosts file and beforeforward
ing to `/etc/resolv.conf)*.override.end
: defines a configuration override that will be imported at the end of the originalCorefile
(i.e. at the very end of theCorefile
)