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