[feat] Add custom options to coredns kubernets plugin (#9608)

pull/9624/head
Marijn van der Giesen 2022-12-28 03:21:27 +01:00 committed by GitHub
parent 2c2e608eac
commit ab80342750
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 0 deletions

View File

@ -56,6 +56,10 @@ Whether or not upstream DNS servers come from `upstream_dns_servers` variable or
These are configurable in inventory in as a dictionary in the `dns_upstream_forward_extra_opts` variable. These are configurable in inventory in as a dictionary in the `dns_upstream_forward_extra_opts` variable.
By default, no other option than the ones hardcoded (see `roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2` and `roles/kubernetes-apps/ansible/templates/nodelocaldns-config.yml.j2`). By default, no other option than the ones hardcoded (see `roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2` and `roles/kubernetes-apps/ansible/templates/nodelocaldns-config.yml.j2`).
### coredns_kubernetes_extra_opts
Custom options to be added to the kubernetes coredns plugin.
### coredns_external_zones ### coredns_external_zones
Array of optional external zones to coredns forward queries to. It's injected into Array of optional external zones to coredns forward queries to. It's injected into

View File

@ -208,6 +208,9 @@ enable_coredns_k8s_endpoint_pod_names: false
# Set forward options for upstream DNS servers in coredns (and nodelocaldns) config # Set forward options for upstream DNS servers in coredns (and nodelocaldns) config
# dns_upstream_forward_extra_opts: # dns_upstream_forward_extra_opts:
# policy: sequential # policy: sequential
# Apply extra options to coredns kubernetes plugin
# coredns_kubernetes_extra_opts:
# - 'fallthrough example.local'
# Can be docker_dns, host_resolvconf or none # Can be docker_dns, host_resolvconf or none
resolvconf_mode: host_resolvconf resolvconf_mode: host_resolvconf

View File

@ -18,6 +18,10 @@ coredns_default_zone_cache_block: |
# dns_upstream_forward_extra_opts: # dns_upstream_forward_extra_opts:
# policy: sequential # policy: sequential
# Apply extra options to coredns kubernetes plugin
# coredns_kubernetes_extra_opts:
# - 'fallthrough example.local'
# nodelocaldns # nodelocaldns
nodelocaldns_cpu_requests: 100m nodelocaldns_cpu_requests: 100m
nodelocaldns_memory_limit: 200Mi nodelocaldns_memory_limit: 200Mi

View File

@ -43,6 +43,11 @@ data:
{% endif %} {% endif %}
{% if enable_coredns_reverse_dns_lookups %} {% if enable_coredns_reverse_dns_lookups %}
fallthrough in-addr.arpa ip6.arpa fallthrough in-addr.arpa ip6.arpa
{% endif %}
{% if coredns_kubernetes_extra_opts is defined %}
{% for opt in coredns_kubernetes_extra_opts %}
{{ opt }}
{% endfor %}
{% endif %} {% endif %}
} }
prometheus :9153 prometheus :9153