feat(coredns): coredns_rewrite_block to perform internal message rewriting (#10045)

Signed-off-by: Maxime Leroy <19607336+maxime1907@users.noreply.github.com>
pull/10074/head
Maxime Leroy 2023-05-12 23:32:46 +02:00 committed by GitHub
parent 86b81a855a
commit 4ffe138dfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -64,6 +64,10 @@ Custom options to be added to the kubernetes coredns plugin.
Extra domains to be forwarded to the kubernetes coredns plugin.
### coredns_rewrite_block
[Rewrite](https://coredns.io/plugins/rewrite/) plugin block to perform internal message rewriting.
### coredns_external_zones
Array of optional external zones to coredns forward queries to. It's injected into

View File

@ -18,6 +18,13 @@ coredns_default_zone_cache_block: |
# whoami
# local
# coredns_rewrite_block: |
# rewrite stop {
# name regex (.*)\.my\.domain {1}.svc.cluster.local
# answer name (.*)\.svc\.cluster\.local {1}.my.domain
# }
# dns_upstream_forward_extra_opts apply to coredns forward section as well as nodelocaldns upstream target forward section
# dns_upstream_forward_extra_opts:
# policy: sequential

View File

@ -38,6 +38,9 @@ data:
health {
lameduck 5s
}
{% if coredns_rewrite_block is defined %}
{{ coredns_rewrite_block | indent(width=8, first=False) }}
{% endif %}
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 %}{
pods insecure