Browse Source
feat: add support for coredns_affinity (#11994)
Signed-off-by: Ho Kim <ho.kim@ulagbulag.io>
Co-authored-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
pull/12439/head
Ho Kim
2 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
12 additions and
15 deletions
-
roles/kubernetes-apps/ansible/defaults/main.yml
-
roles/kubernetes-apps/ansible/templates/coredns-deployment.yml.j2
|
|
@ -13,6 +13,17 @@ dns_prevent_single_point_failure: "{{ 'true' if dns_min_replicas | int > 1 else |
|
|
|
enable_coredns_reverse_dns_lookups: true |
|
|
|
coredns_ordinal_suffix: "" |
|
|
|
# dns_extra_tolerations: [{effect: NoSchedule, operator: "Exists"}] |
|
|
|
coredns_affinity: |
|
|
|
podAntiAffinity: |
|
|
|
preferredDuringSchedulingIgnoredDuringExecution: |
|
|
|
- weight: 100 |
|
|
|
podAffinityTerm: |
|
|
|
labelSelector: |
|
|
|
matchExpressions: |
|
|
|
- key: k8s-app |
|
|
|
operator: In |
|
|
|
values: ["kube-dns"] |
|
|
|
topologyKey: kubernetes.io/hostname |
|
|
|
coredns_deployment_nodeselector: "kubernetes.io/os: linux" |
|
|
|
coredns_default_zone_cache_block: | |
|
|
|
cache 30 |
|
|
|
|
|
@ -38,21 +38,7 @@ spec: |
|
|
|
{{ dns_extra_tolerations | list | to_nice_yaml(indent=2) | indent(8) }} |
|
|
|
{% endif %} |
|
|
|
affinity: |
|
|
|
podAntiAffinity: |
|
|
|
requiredDuringSchedulingIgnoredDuringExecution: |
|
|
|
- topologyKey: "kubernetes.io/hostname" |
|
|
|
labelSelector: |
|
|
|
matchLabels: |
|
|
|
k8s-app: kube-dns{{ coredns_ordinal_suffix }} |
|
|
|
nodeAffinity: |
|
|
|
preferredDuringSchedulingIgnoredDuringExecution: |
|
|
|
- weight: 100 |
|
|
|
preference: |
|
|
|
matchExpressions: |
|
|
|
- key: node-role.kubernetes.io/control-plane |
|
|
|
operator: In |
|
|
|
values: |
|
|
|
- "" |
|
|
|
{{ coredns_affinity | to_nice_yaml(indent=2) | indent(8) }} |
|
|
|
containers: |
|
|
|
- name: coredns |
|
|
|
image: "{{ coredns_image_repo }}:{{ coredns_image_tag }}" |
|
|
|