From 4313c136566aaf9e3f2ef1e43673b11476a2483f Mon Sep 17 00:00:00 2001 From: Navid Nabavi Date: Tue, 9 May 2023 17:15:58 +0330 Subject: [PATCH] [feature] Add coredns_additional_configs to handle any extra configurations for coredns deployment (#10023) (#10025) --- roles/kubernetes-apps/ansible/defaults/main.yml | 4 ++++ roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2 | 3 +++ 2 files changed, 7 insertions(+) diff --git a/roles/kubernetes-apps/ansible/defaults/main.yml b/roles/kubernetes-apps/ansible/defaults/main.yml index 9fa1ac141..68f3c7856 100644 --- a/roles/kubernetes-apps/ansible/defaults/main.yml +++ b/roles/kubernetes-apps/ansible/defaults/main.yml @@ -13,6 +13,10 @@ coredns_ordinal_suffix: "" coredns_deployment_nodeselector: "kubernetes.io/os: linux" coredns_default_zone_cache_block: | cache 30 +# coredns_additional_configs adds any extra configuration to coredns +# coredns_additional_configs: | +# whoami +# local # dns_upstream_forward_extra_opts apply to coredns forward section as well as nodelocaldns upstream target forward section # dns_upstream_forward_extra_opts: diff --git a/roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2 b/roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2 index 36de0d996..2fb409177 100644 --- a/roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2 @@ -31,6 +31,9 @@ data: {% endfor %} {% endif %} .:53 { + {% if coredns_additional_configs is defined %} + {{ coredns_additional_configs | indent(width=8, first=False) }} + {% endif %} errors health { lameduck 5s