Skip to content

Commit

Permalink
Added templating to coredns error to allow for consolidation (#10501)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elias-elastisys authored Oct 10, 2023
1 parent abaddb4 commit d3101d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions roles/kubernetes-apps/ansible/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ coredns_default_zone_cache_block: |
# answer name (.*)\.svc\.cluster\.local {1}.my.domain
# }

# coredns_additional_error_config: |
# consolidate 5m ".* i/o timeout$" warning

# dns_upstream_forward_extra_opts apply to coredns forward section as well as nodelocaldns upstream target forward section
# dns_upstream_forward_extra_opts:
Expand Down
16 changes: 12 additions & 4 deletions roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ data:
{% for block in coredns_external_zones %}
{{ block['zones'] | join(' ') }} {
log
errors
errors {
{% if coredns_additional_error_config is defined %}
{{ coredns_additional_error_config | indent(width=10, first=False) }}
{% endif %}
}
{% if block['rewrite'] is defined and block['rewrite'] | length > 0 %}
{% for rewrite_match in block['rewrite'] %}
rewrite {{ rewrite_match }}
Expand All @@ -31,10 +35,14 @@ data:
{% endfor %}
{% endif %}
.:53 {
{% if coredns_additional_configs is defined %}
{% if coredns_additional_configs is defined %}
{{ coredns_additional_configs | indent(width=8, first=False) }}
{% endif %}
errors
{% endif %}
errors {
{% if coredns_additional_error_config is defined %}
{{ coredns_additional_error_config | indent(width=10, first=False) }}
{% endif %}
}
health {
lameduck 5s
}
Expand Down

0 comments on commit d3101d6

Please sign in to comment.