Convert CoreDNS Secondary to kubectl_apply_stdin

Note that we're reapplying the RBAC/Sa/Config from coredns which is not
strictly necessary, but harmless, when the secondary is enabled.
This commit is contained in:
Max Gautier
2024-11-09 16:03:51 +01:00
parent e0c9152bd4
commit 4b7125f5be
2 changed files with 15 additions and 23 deletions

View File

@@ -32,6 +32,21 @@
clusterIP: "{{ skydns_server }}"
when: dns_mode in ['coredns', 'coredns_dual']
- name: Kubernetes Apps | CoreDNS Secondary
command:
cmd: "{{ kubectl_apply_stdin }}"
stdin: "{{ lookup('template', item) }}"
delegate_to: "{{ groups['kube_control_plane'][0] }}"
run_once: true
loop: "{{ coredns_manifests | flatten }}"
tags:
- coredns
vars:
clusterIP: "{{ skydns_server_secondary }}"
coredns_ordinal_suffix: "-secondary"
when:
- dns_mode == 'coredns_dual'
- name: Kubernetes Apps | Start Resources
kube:
name: "{{ item.item.name }}"
@@ -41,7 +56,6 @@
filename: "{{ kube_config_dir }}/{{ item.item.file }}"
state: "latest"
with_items:
- "{{ coredns_secondary_manifests.results | default({}) }}"
- "{{ nodelocaldns_manifests.results | default({}) }}"
- "{{ nodelocaldns_second_manifests.results | default({}) }}"
when: