3e3ee0aeb1
* Add support for running a nodelocal dns cache
After encountering dns issues in a cluster I was recently working on I
noticed Kubernetes 1.13 introduced support for running a nodelocal dns
cache.
I believe this can usefull for more people.
73b548db06
https://github.com/kubernetes/enhancements/blob/master/keps/sig-network/0030-nodelocal-dns-cache.md
* Add requested changes
* Add additional requested changes + documentation
* Add requested changes after review
* Replace incorrect variable
71 lines
1.7 KiB
Django/Jinja
71 lines
1.7 KiB
Django/Jinja
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: nodelocaldns
|
|
namespace: kube-system
|
|
labels:
|
|
addonmanager.kubernetes.io/mode: EnsureExists
|
|
|
|
data:
|
|
Corefile: |
|
|
{{ dns_domain }}:53 {
|
|
errors
|
|
cache 30
|
|
reload
|
|
loop
|
|
bind {{ nodelocaldns_ip }}
|
|
{% if secondaryclusterIP is defined and dns_mode == 'coredns_dual' %}
|
|
forward . {{ clusterIP }} {{ secondaryclusterIP }} {
|
|
{% else %}
|
|
forward . {{ clusterIP }} {
|
|
{% endif %}
|
|
force_tcp
|
|
}
|
|
prometheus :9253
|
|
health {{ nodelocaldns_ip }}:8080
|
|
}
|
|
in-addr.arpa:53 {
|
|
errors
|
|
cache 30
|
|
reload
|
|
loop
|
|
bind {{ nodelocaldns_ip }}
|
|
{% if secondaryclusterIP is defined %}
|
|
forward . {{ clusterIP }} {{ secondaryclusterIP }} {
|
|
{% else %}
|
|
forward . {{ clusterIP }} {
|
|
{% endif %}
|
|
force_tcp
|
|
}
|
|
prometheus :9253
|
|
}
|
|
ip6.arpa:53 {
|
|
errors
|
|
cache 30
|
|
reload
|
|
loop
|
|
bind {{ nodelocaldns_ip }}
|
|
{% if secondaryclusterIP is defined %}
|
|
forward . {{ clusterIP }} {{ secondaryclusterIP }} {
|
|
{% else %}
|
|
forward . {{ clusterIP }} {
|
|
{% endif %}
|
|
force_tcp
|
|
}
|
|
prometheus :9253
|
|
}
|
|
.:53 {
|
|
errors
|
|
cache 30
|
|
reload
|
|
loop
|
|
bind {{ nodelocaldns_ip }}
|
|
{% if resolvconf_mode == 'host_resolvconf' and upstream_dns_servers is defined and upstream_dns_servers|length > 0 %}
|
|
forward . {{ upstream_dns_servers|join(' ') }} {
|
|
{% else %}
|
|
forward . /etc/resolv.conf {
|
|
{% endif %}
|
|
force_tcp
|
|
}
|
|
prometheus :9253
|
|
}
|