mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-09 19:58:07 +03:00
nodelocaldns: allow a secondary pod for nodelocaldns for local-HA (#8100)
* nodelocaldns: allow a secondary pod for nodelocaldns for local-HA * CI: add job to test nodelocaldns secondary
This commit is contained in:
@@ -43,3 +43,31 @@
|
||||
tags:
|
||||
- nodelocaldns
|
||||
- coredns
|
||||
|
||||
- name: Kubernetes Apps | Lay Down nodelocaldns-secondary Template
|
||||
template:
|
||||
src: "{{ item.file }}.j2"
|
||||
dest: "{{ kube_config_dir }}/{{ item.file }}"
|
||||
with_items:
|
||||
- { name: nodelocaldns, file: nodelocaldns-second-daemonset.yml, type: daemonset }
|
||||
register: nodelocaldns_second_manifests
|
||||
vars:
|
||||
forwardTarget: >-
|
||||
{%- if secondaryclusterIP is defined and dns_mode == 'coredns_dual' -%}
|
||||
{{ primaryClusterIP }} {{ secondaryclusterIP }}
|
||||
{%- else -%}
|
||||
{{ primaryClusterIP }}
|
||||
{%- endif -%}
|
||||
upstreamForwardTarget: >-
|
||||
{%- if resolvconf_mode == 'host_resolvconf' and upstream_dns_servers is defined and upstream_dns_servers|length > 0 -%}
|
||||
{{ upstream_dns_servers|join(' ') }}
|
||||
{%- else -%}
|
||||
/etc/resolv.conf
|
||||
{%- endif -%}
|
||||
when:
|
||||
- enable_nodelocaldns
|
||||
- enable_nodelocaldns_secondary
|
||||
- inventory_hostname == groups['kube_control_plane'] | first
|
||||
tags:
|
||||
- nodelocaldns
|
||||
- coredns
|
||||
|
||||
Reference in New Issue
Block a user