mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-10-29 22:03:22 -02:30
* fix(custom_cni): make namespace optional Keep kube-system as the default for existing manifests. An empty custom_cni_namespace omits kubectl's namespace flag so manifests spanning multiple namespaces can be applied without changing legacy behavior. Signed-off-by: Kay Yan <kay.yan@daocloud.io> * docs(custom_cni): document multi-namespace manifests Signed-off-by: Kay Yan <kay.yan@daocloud.io> --------- Signed-off-by: Kay Yan <kay.yan@daocloud.io>
30 lines
982 B
YAML
30 lines
982 B
YAML
---
|
|
- name: Custom CNI | Manifest deployment
|
|
when: not custom_cni_chart_release_name | length > 0
|
|
block:
|
|
- name: Custom CNI | Check Custom CNI Manifests
|
|
assert:
|
|
that:
|
|
- "custom_cni_manifests | length > 0"
|
|
msg: "custom_cni_manifests should not be empty"
|
|
|
|
- name: Custom CNI | Copy Custom manifests
|
|
template:
|
|
src: "{{ item }}"
|
|
dest: "{{ kube_config_dir }}/{{ item | basename | replace('.j2', '') }}"
|
|
mode: "0644"
|
|
loop: "{{ custom_cni_manifests }}"
|
|
delegate_to: "{{ groups['kube_control_plane'] | first }}"
|
|
run_once: true
|
|
|
|
- name: Custom CNI | Start Resources
|
|
kube:
|
|
namespace: "{{ custom_cni_namespace | default(omit, true) }}"
|
|
kubectl: "{{ bin_dir }}/kubectl"
|
|
filename: "{{ kube_config_dir }}/{{ item | basename | replace('.j2', '') }}"
|
|
state: "latest"
|
|
wait: true
|
|
loop: "{{ custom_cni_manifests }}"
|
|
delegate_to: "{{ groups['kube_control_plane'] | first }}"
|
|
run_once: true
|