You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.8 KiB

  1. ---
  2. apiVersion: v1
  3. kind: ConfigMap
  4. metadata:
  5. name: coredns
  6. namespace: kube-system
  7. labels:
  8. addonmanager.kubernetes.io/mode: EnsureExists
  9. data:
  10. Corefile: |
  11. {% if coredns_external_zones is defined and coredns_external_zones|length > 0 %}
  12. {% for block in coredns_external_zones %}
  13. {{ block['zones'] | join(' ') }} {
  14. log
  15. errors
  16. forward . {{ block['nameservers'] | join(' ') }}
  17. loadbalance
  18. cache {{ block['cache'] | default(5) }}
  19. reload
  20. {% if dns_etchosts | default(None) %}
  21. hosts /etc/coredns/hosts {
  22. fallthrough
  23. }
  24. {% endif %}
  25. }
  26. {% endfor %}
  27. {% endif %}
  28. .:53 {
  29. errors
  30. health {
  31. lameduck 5s
  32. }
  33. ready
  34. kubernetes {{ dns_domain }} {% if enable_coredns_reverse_dns_lookups %}in-addr.arpa ip6.arpa {% endif %}{
  35. pods insecure
  36. {% if enable_coredns_k8s_endpoint_pod_names %}
  37. endpoint_pod_names
  38. {% endif %}
  39. {% if enable_coredns_reverse_dns_lookups %}
  40. fallthrough in-addr.arpa ip6.arpa
  41. {% endif %}
  42. }
  43. prometheus :9153
  44. {% if resolvconf_mode == 'host_resolvconf' and upstream_dns_servers is defined and upstream_dns_servers|length > 0 %}
  45. forward . {{ upstream_dns_servers|join(' ') }} {
  46. prefer_udp
  47. }
  48. {% else %}
  49. forward . /etc/resolv.conf {
  50. prefer_udp
  51. }
  52. {% endif %}
  53. {% if enable_coredns_k8s_external %}
  54. k8s_external {{ coredns_k8s_external_zone }}
  55. {% endif %}
  56. cache 30
  57. loop
  58. reload
  59. loadbalance
  60. {% if dns_etchosts | default(None) %}
  61. hosts /etc/coredns/hosts {
  62. fallthrough
  63. }
  64. {% endif %}
  65. }
  66. {% if dns_etchosts | default(None) %}
  67. hosts: |
  68. {{ dns_etchosts | indent(width=4, indentfirst=None) }}
  69. {% endif %}