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(' ') }} {
|
|
|
|
|
log
|
|
|
|
|
errors
|
|
|
|
|
forward . {{ block['nameservers'] | join(' ') }}
|
|
|
|
|
loadbalance
|
|
|
|
|
cache {{ block['cache'] | default(5) }}
|
|
|
|
|
reload
|
|
|
|
|
}
|
|
|
|
|
{% endfor %}
|
|
|
|
|
{% endif %}
|
2018-03-13 11:00:05 +00:00
|
|
|
|
.:53 {
|
|
|
|
|
errors
|
|
|
|
|
health
|
2019-05-28 13:47:57 +00:00
|
|
|
|
ready
|
2018-06-13 18:52:35 +00:00
|
|
|
|
kubernetes {{ dns_domain }} in-addr.arpa ip6.arpa {
|
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
|
|
|
|
|
{% endif %}
|
2018-10-08 14:08:51 +00:00
|
|
|
|
{% if resolvconf_mode == 'host_resolvconf' and upstream_dns_servers is defined and upstream_dns_servers|length > 0 %}
|
2019-04-09 09:19:06 +00:00
|
|
|
|
upstream {{ upstream_dns_servers|join(' ') }}
|
2018-10-08 14:08:51 +00:00
|
|
|
|
{% else %}
|
2018-03-13 11:00:05 +00:00
|
|
|
|
upstream /etc/resolv.conf
|
2018-10-08 14:08:51 +00:00
|
|
|
|
{% endif %}
|
2018-03-13 11:00:05 +00:00
|
|
|
|
fallthrough in-addr.arpa ip6.arpa
|
|
|
|
|
}
|
|
|
|
|
prometheus :9153
|
2018-10-08 14:08:51 +00:00
|
|
|
|
{% if resolvconf_mode == 'host_resolvconf' and upstream_dns_servers is defined and upstream_dns_servers|length > 0 %}
|
2019-06-05 06:27:55 +00:00
|
|
|
|
forward . {{ upstream_dns_servers|join(' ') }} {
|
|
|
|
|
prefer_udp
|
|
|
|
|
}
|
2018-10-08 14:08:51 +00:00
|
|
|
|
{% else %}
|
2019-06-05 06:27:55 +00:00
|
|
|
|
forward . /etc/resolv.conf {
|
|
|
|
|
prefer_udp
|
|
|
|
|
}
|
2019-07-16 07:53:23 +00:00
|
|
|
|
{% endif %}
|
|
|
|
|
{% if enable_coredns_k8s_external %}
|
|
|
|
|
k8s_external {{ coredns_k8s_external_zone }}
|
2018-10-08 14:08:51 +00:00
|
|
|
|
{% endif %}
|
2018-03-13 11:00:05 +00:00
|
|
|
|
cache 30
|
2018-10-11 07:12:58 +00:00
|
|
|
|
loop
|
|
|
|
|
reload
|
|
|
|
|
loadbalance
|
2018-03-13 11:00:05 +00:00
|
|
|
|
}
|