From 110c1f764c5a5a5215414e2caa148e5701daa4dd Mon Sep 17 00:00:00 2001 From: Samuel Liu Date: Fri, 1 Nov 2024 16:41:35 +0800 Subject: [PATCH] coredns: add includeUnschedulableNodes for dns-autoscaler --- roles/kubernetes-apps/ansible/defaults/main.yml | 1 + roles/kubernetes-apps/ansible/templates/dns-autoscaler.yml.j2 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/kubernetes-apps/ansible/defaults/main.yml b/roles/kubernetes-apps/ansible/defaults/main.yml index daebd07f6..f1355c056 100644 --- a/roles/kubernetes-apps/ansible/defaults/main.yml +++ b/roles/kubernetes-apps/ansible/defaults/main.yml @@ -10,6 +10,7 @@ dns_min_replicas: "{{ [2, groups['k8s_cluster'] | length] | min }}" dns_nodes_per_replica: 16 dns_cores_per_replica: 256 dns_prevent_single_point_failure: "{{ 'true' if dns_min_replicas | int > 1 else 'false' }}" +dns_include_unschedulable_nodes: false enable_coredns_reverse_dns_lookups: true coredns_ordinal_suffix: "" # dns_extra_tolerations: [{effect: NoSchedule, operator: "Exists"}] diff --git a/roles/kubernetes-apps/ansible/templates/dns-autoscaler.yml.j2 b/roles/kubernetes-apps/ansible/templates/dns-autoscaler.yml.j2 index c10ebf97f..bdcae59cf 100644 --- a/roles/kubernetes-apps/ansible/templates/dns-autoscaler.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/dns-autoscaler.yml.j2 @@ -78,7 +78,7 @@ spec: command: - /cluster-proportional-autoscaler - --namespace=kube-system - - --default-params={"linear":{"preventSinglePointFailure":{{ dns_prevent_single_point_failure }},"coresPerReplica":{{ dns_cores_per_replica }},"nodesPerReplica":{{ dns_nodes_per_replica }},"min":{{ dns_min_replicas }}}} + - --default-params={"linear":{"preventSinglePointFailure":{{ dns_prevent_single_point_failure }},"coresPerReplica":{{ dns_cores_per_replica }},"nodesPerReplica":{{ dns_nodes_per_replica }},"min":{{ dns_min_replicas }},"includeUnschedulableNodes":{{ dns_include_unschedulable_nodes}}}} - --logtostderr=true - --v=2 - --configmap=dns-autoscaler{{ coredns_ordinal_suffix }}