2018-12-11 01:28:03 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: ConfigMap
|
|
|
|
metadata:
|
|
|
|
name: nodelocaldns
|
|
|
|
namespace: kube-system
|
|
|
|
labels:
|
|
|
|
addonmanager.kubernetes.io/mode: EnsureExists
|
|
|
|
|
|
|
|
data:
|
|
|
|
Corefile: |
|
2020-03-14 13:26:34 +00:00
|
|
|
{% if nodelocaldns_external_zones is defined and nodelocaldns_external_zones|length > 0 %}
|
|
|
|
{% for block in nodelocaldns_external_zones %}
|
|
|
|
{{ block['zones'] | join(' ') }} {
|
|
|
|
errors
|
|
|
|
cache {{ block['cache'] | default(30) }}
|
|
|
|
reload
|
|
|
|
loop
|
|
|
|
bind {{ nodelocaldns_ip }}
|
|
|
|
forward . {{ block['nameservers'] | join(' ') }}
|
2021-11-09 17:57:47 +00:00
|
|
|
prometheus {% if nodelocaldns_bind_metrics_host_ip %}{$MY_HOST_IP}{% endif %}:{{ nodelocaldns_prometheus_port }}
|
2020-03-14 13:26:34 +00:00
|
|
|
log
|
2020-06-26 07:03:31 +00:00
|
|
|
{% if dns_etchosts | default(None) %}
|
|
|
|
hosts /etc/coredns/hosts {
|
|
|
|
fallthrough
|
|
|
|
}
|
|
|
|
{% endif %}
|
2020-03-14 13:26:34 +00:00
|
|
|
}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2018-12-11 01:28:03 +00:00
|
|
|
{{ dns_domain }}:53 {
|
|
|
|
errors
|
2019-04-04 07:38:51 +00:00
|
|
|
cache {
|
|
|
|
success 9984 30
|
|
|
|
denial 9984 5
|
|
|
|
}
|
2018-12-11 01:28:03 +00:00
|
|
|
reload
|
|
|
|
loop
|
|
|
|
bind {{ nodelocaldns_ip }}
|
2019-01-29 07:39:27 +00:00
|
|
|
forward . {{ forwardTarget }} {
|
|
|
|
force_tcp
|
2018-12-11 01:28:03 +00:00
|
|
|
}
|
2021-11-09 17:57:47 +00:00
|
|
|
prometheus {% if nodelocaldns_bind_metrics_host_ip %}{$MY_HOST_IP}{% endif %}:{{ nodelocaldns_prometheus_port }}
|
2019-07-09 07:52:01 +00:00
|
|
|
health {{ nodelocaldns_ip }}:{{ nodelocaldns_health_port }}
|
2020-06-26 07:03:31 +00:00
|
|
|
{% if dns_etchosts | default(None) %}
|
|
|
|
hosts /etc/coredns/hosts {
|
|
|
|
fallthrough
|
|
|
|
}
|
|
|
|
{% endif %}
|
2019-01-29 07:39:27 +00:00
|
|
|
}
|
2018-12-11 01:28:03 +00:00
|
|
|
in-addr.arpa:53 {
|
|
|
|
errors
|
|
|
|
cache 30
|
|
|
|
reload
|
|
|
|
loop
|
|
|
|
bind {{ nodelocaldns_ip }}
|
2019-01-29 07:39:27 +00:00
|
|
|
forward . {{ forwardTarget }} {
|
|
|
|
force_tcp
|
2018-12-11 01:28:03 +00:00
|
|
|
}
|
2021-11-09 17:57:47 +00:00
|
|
|
prometheus {% if nodelocaldns_bind_metrics_host_ip %}{$MY_HOST_IP}{% endif %}:{{ nodelocaldns_prometheus_port }}
|
2019-01-29 07:39:27 +00:00
|
|
|
}
|
2018-12-11 01:28:03 +00:00
|
|
|
ip6.arpa:53 {
|
|
|
|
errors
|
|
|
|
cache 30
|
|
|
|
reload
|
|
|
|
loop
|
|
|
|
bind {{ nodelocaldns_ip }}
|
2019-01-29 07:39:27 +00:00
|
|
|
forward . {{ forwardTarget }} {
|
|
|
|
force_tcp
|
2018-12-11 01:28:03 +00:00
|
|
|
}
|
2021-11-09 17:57:47 +00:00
|
|
|
prometheus {% if nodelocaldns_bind_metrics_host_ip %}{$MY_HOST_IP}{% endif %}:{{ nodelocaldns_prometheus_port }}
|
2019-01-29 07:39:27 +00:00
|
|
|
}
|
2018-12-11 01:28:03 +00:00
|
|
|
.:53 {
|
|
|
|
errors
|
|
|
|
cache 30
|
|
|
|
reload
|
|
|
|
loop
|
|
|
|
bind {{ nodelocaldns_ip }}
|
2019-04-10 19:40:09 +00:00
|
|
|
forward . {{ upstreamForwardTarget }}
|
2021-11-09 17:57:47 +00:00
|
|
|
prometheus {% if nodelocaldns_bind_metrics_host_ip %}{$MY_HOST_IP}{% endif %}:{{ nodelocaldns_prometheus_port }}
|
2020-06-26 07:03:31 +00:00
|
|
|
{% if dns_etchosts | default(None) %}
|
|
|
|
hosts /etc/coredns/hosts {
|
|
|
|
fallthrough
|
|
|
|
}
|
|
|
|
{% endif %}
|
2019-01-29 07:39:27 +00:00
|
|
|
}
|
2021-11-09 17:57:47 +00:00
|
|
|
{% if enable_nodelocaldns_secondary %}
|
|
|
|
Corefile-second: |
|
|
|
|
{% if nodelocaldns_external_zones is defined and nodelocaldns_external_zones|length > 0 %}
|
|
|
|
{% for block in nodelocaldns_external_zones %}
|
|
|
|
{{ block['zones'] | join(' ') }} {
|
|
|
|
errors
|
|
|
|
cache {{ block['cache'] | default(30) }}
|
|
|
|
reload
|
|
|
|
loop
|
|
|
|
bind {{ nodelocaldns_ip }}
|
|
|
|
forward . {{ block['nameservers'] | join(' ') }}
|
|
|
|
prometheus {% if nodelocaldns_bind_metrics_host_ip %}{$MY_HOST_IP}{% endif %}:{{ nodelocaldns_secondary_prometheus_port }}
|
|
|
|
log
|
|
|
|
{% if dns_etchosts | default(None) %}
|
|
|
|
hosts /etc/coredns/hosts {
|
|
|
|
fallthrough
|
|
|
|
}
|
|
|
|
{% endif %}
|
|
|
|
}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{{ dns_domain }}:53 {
|
|
|
|
errors
|
|
|
|
cache {
|
|
|
|
success 9984 30
|
|
|
|
denial 9984 5
|
|
|
|
}
|
|
|
|
reload
|
|
|
|
loop
|
|
|
|
bind {{ nodelocaldns_ip }}
|
|
|
|
forward . {{ forwardTarget }} {
|
|
|
|
force_tcp
|
|
|
|
}
|
|
|
|
prometheus {% if nodelocaldns_bind_metrics_host_ip %}{$MY_HOST_IP}{% endif %}:{{ nodelocaldns_secondary_prometheus_port }}
|
|
|
|
health {{ nodelocaldns_ip }}:{{ nodelocaldns_second_health_port }}
|
|
|
|
{% if dns_etchosts | default(None) %}
|
|
|
|
hosts /etc/coredns/hosts {
|
|
|
|
fallthrough
|
|
|
|
}
|
|
|
|
{% endif %}
|
|
|
|
}
|
|
|
|
in-addr.arpa:53 {
|
|
|
|
errors
|
|
|
|
cache 30
|
|
|
|
reload
|
|
|
|
loop
|
|
|
|
bind {{ nodelocaldns_ip }}
|
|
|
|
forward . {{ forwardTarget }} {
|
|
|
|
force_tcp
|
|
|
|
}
|
|
|
|
prometheus {% if nodelocaldns_bind_metrics_host_ip %}{$MY_HOST_IP}{% endif %}:{{ nodelocaldns_secondary_prometheus_port }}
|
|
|
|
}
|
|
|
|
ip6.arpa:53 {
|
|
|
|
errors
|
|
|
|
cache 30
|
|
|
|
reload
|
|
|
|
loop
|
|
|
|
bind {{ nodelocaldns_ip }}
|
|
|
|
forward . {{ forwardTarget }} {
|
|
|
|
force_tcp
|
|
|
|
}
|
|
|
|
prometheus {% if nodelocaldns_bind_metrics_host_ip %}{$MY_HOST_IP}{% endif %}:{{ nodelocaldns_secondary_prometheus_port }}
|
|
|
|
}
|
|
|
|
.:53 {
|
|
|
|
errors
|
|
|
|
cache 30
|
|
|
|
reload
|
|
|
|
loop
|
|
|
|
bind {{ nodelocaldns_ip }}
|
|
|
|
forward . {{ upstreamForwardTarget }}
|
|
|
|
prometheus {% if nodelocaldns_bind_metrics_host_ip %}{$MY_HOST_IP}{% endif %}:{{ nodelocaldns_secondary_prometheus_port }}
|
|
|
|
{% if dns_etchosts | default(None) %}
|
|
|
|
hosts /etc/coredns/hosts {
|
|
|
|
fallthrough
|
|
|
|
}
|
|
|
|
{% endif %}
|
|
|
|
}
|
|
|
|
{% endif %}
|
2020-06-26 07:03:31 +00:00
|
|
|
{% if dns_etchosts | default(None) %}
|
|
|
|
hosts: |
|
2020-11-28 16:32:47 +00:00
|
|
|
{{ dns_etchosts | indent(width=4, indentfirst=None) }}
|
2020-06-26 07:03:31 +00:00
|
|
|
{% endif %}
|