diff --git a/roles/kubernetes-apps/ansible/tasks/coredns.yml b/roles/kubernetes-apps/ansible/tasks/coredns.yml index d8f854774..a5f7b198c 100644 --- a/roles/kubernetes-apps/ansible/tasks/coredns.yml +++ b/roles/kubernetes-apps/ansible/tasks/coredns.yml @@ -21,6 +21,7 @@ when: - dns_mode in ['coredns', 'coredns_dual'] - inventory_hostname == groups['kube_control_plane'][0] + - enable_dns_autoscaler or item.name != 'dns-autoscaler' tags: - coredns @@ -40,5 +41,6 @@ when: - dns_mode == 'coredns_dual' - inventory_hostname == groups['kube_control_plane'][0] + - enable_dns_autoscaler or item.name != 'dns-autoscaler' tags: - coredns diff --git a/roles/kubespray-defaults/defaults/main/main.yml b/roles/kubespray-defaults/defaults/main/main.yml index 611947595..a18505bcb 100644 --- a/roles/kubespray-defaults/defaults/main/main.yml +++ b/roles/kubespray-defaults/defaults/main/main.yml @@ -99,6 +99,9 @@ docker_dns_options: # Can be coredns, coredns_dual, manual, or none dns_mode: coredns +# Enable dns autoscaler +enable_dns_autoscaler: true + # Enable nodelocal dns cache enable_nodelocaldns: true enable_nodelocaldns_secondary: false