Compare commits

...

4 Commits

Author SHA1 Message Date
Techno Tim
cb55257925 Merge 7239c927de into b86156b995 2024-07-27 19:24:12 +00:00
Timothy Stewart
7239c927de fix(cilium): use cilium lb 2024-07-27 14:24:03 -05:00
Timothy Stewart
15e97bad1d fix(cilium): use cilium lb 2024-07-27 12:32:22 -05:00
Timothy Stewart
4bee4230de fix(cilium): changing test interface 2024-07-27 11:24:54 -05:00
4 changed files with 46 additions and 16 deletions

View File

@@ -6,7 +6,7 @@
ansible.builtin.set_fact:
# See:
# https://github.com/flannel-io/flannel/blob/67d603aaf45ef80f5dd39f43714fc5e6f8a637eb/Documentation/troubleshooting.md#Vagrant
cilium_iface: eth1
cilium_iface: eth0
# The test VMs might be a bit slow, so we give them more time to join the cluster:
retry_count: 45

View File

@@ -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: cilium_iface
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 LB 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 LB 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:

View File

@@ -19,16 +19,3 @@ spec: # CiliumBGPPeeringPolicySpec
serviceSelector:
matchExpressions:
- {key: somekey, operator: NotIn, values: ['never-used-value']}
---
apiVersion: "cilium.io/v2alpha1"
kind: CiliumLoadBalancerIPPool
metadata:
name: "01-lb-pool"
spec:
blocks:
{% if "/" in cilium_bgp_lb_cidr %}
- cidr: {{ cilium_bgp_lb_cidr }}
{% else %}
- start: {{ cilium_bgp_lb_cidr.split('-')[0] }}
stop: {{ cilium_bgp_lb_cidr.split('-')[1] }}
{% endif %}

View File

@@ -0,0 +1,13 @@
---
apiVersion: "cilium.io/v2alpha1"
kind: CiliumLoadBalancerIPPool
metadata:
name: "01-lb-pool"
spec:
blocks:
{% if "/" in cilium_bgp_lb_cidr %}
- cidr: {{ cilium_bgp_lb_cidr }}
{% else %}
- start: {{ cilium_bgp_lb_cidr.split('-')[0] }}
stop: {{ cilium_bgp_lb_cidr.split('-')[1] }}
{% endif %}