mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2025-12-29 04:02:38 +01:00
fix(cilium): use cilium lb
This commit is contained in:
@@ -221,10 +221,9 @@
|
||||
- name: Configure Cilium BGP
|
||||
when: cilium_bgp
|
||||
block:
|
||||
|
||||
- name: Copy BGP manifests to first master
|
||||
ansible.builtin.template:
|
||||
src: "cilium.crs.j2"
|
||||
src: "cilium-bgp.crs.j2"
|
||||
dest: /tmp/k3s/cilium-bgp.yaml
|
||||
owner: root
|
||||
group: root
|
||||
@@ -247,6 +246,37 @@
|
||||
ansible.builtin.command: "{{ item }}"
|
||||
loop:
|
||||
- k3s kubectl get CiliumBGPPeeringPolicy.cilium.io
|
||||
changed_when: false
|
||||
loop_control:
|
||||
label: "{{ item }}"
|
||||
|
||||
- name: Configure Cilium Load Balancer
|
||||
when: kube_vip_lb_ip_range is not defined and (cilium_bgp is not defined or cilium_iface is not defined)
|
||||
block:
|
||||
- name: Copy Load Balancer manifests to first master
|
||||
ansible.builtin.template:
|
||||
src: "cilium-lb.crs.j2"
|
||||
dest: /tmp/k3s/cilium-lb.yaml
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
|
||||
- name: Apply BGP manifests
|
||||
ansible.builtin.command:
|
||||
cmd: kubectl apply -f /tmp/k3s/cilium-lb.yaml
|
||||
register: apply_cr
|
||||
changed_when: "'configured' in apply_cr.stdout or 'created' in apply_cr.stdout"
|
||||
failed_when: "'is invalid' in apply_cr.stderr"
|
||||
ignore_errors: true
|
||||
|
||||
- name: Print error message if BGP manifests application fails
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ apply_cr.stderr }}"
|
||||
when: "'is invalid' in apply_cr.stderr"
|
||||
|
||||
- name: Test for LB config resources
|
||||
ansible.builtin.command: "{{ item }}"
|
||||
loop:
|
||||
- k3s kubectl get CiliumLoadBalancerIPPool.cilium.io
|
||||
changed_when: false
|
||||
loop_control:
|
||||
|
||||
Reference in New Issue
Block a user