2018-03-13 11:00:05 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ConfigMap
|
|
|
|
metadata:
|
|
|
|
name: coredns
|
2018-03-30 11:29:13 +00:00
|
|
|
namespace: kube-system
|
2018-11-15 17:52:12 +00:00
|
|
|
labels:
|
|
|
|
addonmanager.kubernetes.io/mode: EnsureExists
|
2018-03-13 11:00:05 +00:00
|
|
|
data:
|
|
|
|
Corefile: |
|
2020-03-27 06:34:23 +00:00
|
|
|
{% if coredns_external_zones is defined and coredns_external_zones|length > 0 %}
|
|
|
|
{% for block in coredns_external_zones %}
|
|
|
|
{{ block['zones'] | join(' ') }} {
|
2020-03-27 18:39:54 +00:00
|
|
|
log
|
|
|
|
errors
|
2022-09-03 23:16:35 +00:00
|
|
|
{% if block['rewrite'] is defined and block['rewrite']|length > 0 %}
|
|
|
|
{% for rewrite_match in block['rewrite'] %}
|
|
|
|
rewrite {{ rewrite_match }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2020-03-27 18:39:54 +00:00
|
|
|
forward . {{ block['nameservers'] | join(' ') }}
|
|
|
|
loadbalance
|
|
|
|
cache {{ block['cache'] | default(5) }}
|
|
|
|
reload
|
2020-06-26 07:03:31 +00:00
|
|
|
{% if dns_etchosts | default(None) %}
|
|
|
|
hosts /etc/coredns/hosts {
|
|
|
|
fallthrough
|
|
|
|
}
|
|
|
|
{% endif %}
|
2020-03-27 18:39:54 +00:00
|
|
|
}
|
2020-03-27 06:34:23 +00:00
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2018-03-13 11:00:05 +00:00
|
|
|
.:53 {
|
|
|
|
errors
|
2020-04-22 12:27:52 +00:00
|
|
|
health {
|
|
|
|
lameduck 5s
|
|
|
|
}
|
2019-05-28 13:47:57 +00:00
|
|
|
ready
|
2020-09-25 09:33:11 +00:00
|
|
|
kubernetes {{ dns_domain }} {% if enable_coredns_reverse_dns_lookups %}in-addr.arpa ip6.arpa {% endif %}{
|
2018-03-13 11:00:05 +00:00
|
|
|
pods insecure
|
2019-07-31 18:26:15 +00:00
|
|
|
{% if enable_coredns_k8s_endpoint_pod_names %}
|
|
|
|
endpoint_pod_names
|
2018-10-08 14:08:51 +00:00
|
|
|
{% endif %}
|
2020-09-25 09:33:11 +00:00
|
|
|
{% if enable_coredns_reverse_dns_lookups %}
|
2018-03-13 11:00:05 +00:00
|
|
|
fallthrough in-addr.arpa ip6.arpa
|
2020-09-25 09:33:11 +00:00
|
|
|
{% endif %}
|
2018-03-13 11:00:05 +00:00
|
|
|
}
|
|
|
|
prometheus :9153
|
2022-11-08 14:44:25 +00:00
|
|
|
forward . {{ upstream_dns_servers|join(' ') if upstream_dns_servers is defined and upstream_dns_servers|length > 0 else '/etc/resolv.conf' }} {
|
2019-06-05 06:27:55 +00:00
|
|
|
prefer_udp
|
2022-09-22 11:27:03 +00:00
|
|
|
max_concurrent 1000
|
2022-11-08 14:44:25 +00:00
|
|
|
{% if dns_upstream_forward_extra_opts is defined %}
|
|
|
|
{% for optname, optvalue in dns_upstream_forward_extra_opts.items() %}
|
|
|
|
{{ optname }} {{ optvalue }}
|
|
|
|
{% endfor %}
|
2019-07-16 07:53:23 +00:00
|
|
|
{% endif %}
|
2022-11-08 14:44:25 +00:00
|
|
|
}
|
2019-07-16 07:53:23 +00:00
|
|
|
{% if enable_coredns_k8s_external %}
|
|
|
|
k8s_external {{ coredns_k8s_external_zone }}
|
2018-10-08 14:08:51 +00:00
|
|
|
{% endif %}
|
2022-02-01 08:48:18 +00:00
|
|
|
{{ coredns_default_zone_cache_block | indent(width=8, first=False) }}
|
2018-10-11 07:12:58 +00:00
|
|
|
loop
|
|
|
|
reload
|
|
|
|
loadbalance
|
2020-06-26 07:03:31 +00:00
|
|
|
{% if dns_etchosts | default(None) %}
|
|
|
|
hosts /etc/coredns/hosts {
|
|
|
|
fallthrough
|
|
|
|
}
|
|
|
|
{% endif %}
|
2018-03-13 11:00:05 +00:00
|
|
|
}
|
2020-06-26 07:03:31 +00:00
|
|
|
{% if dns_etchosts | default(None) %}
|
|
|
|
hosts: |
|
2021-11-24 16:56:21 +00:00
|
|
|
{{ dns_etchosts | indent(width=4, first=False) }}
|
2020-06-26 07:03:31 +00:00
|
|
|
{% endif %}
|