Browse Source

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 2 years ago
committed by GitHub
parent
commit
4ffe138dfa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions
  1. 4
      docs/dns-stack.md
  2. 7
      roles/kubernetes-apps/ansible/defaults/main.yml
  3. 3
      roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2

4
docs/dns-stack.md

@ -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

7
roles/kubernetes-apps/ansible/defaults/main.yml

@ -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

3
roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2

@ -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

Loading…
Cancel
Save