9 Commits

Author SHA1 Message Date
Techno Tim 4a5d3954ca Merge branch 'master' into fix-metallb-updates 2024-01-27 17:30:51 -06:00
Techno Tim 96b168889c Merge branch 'master' into fix-metallb-updates 2024-01-27 16:34:26 -06:00
Techno Tim 0bac1f115a Merge branch 'master' into fix-metallb-updates 2024-01-26 20:37:04 -06:00
Harald Fielker f93839ee10 Merge branch 'fix-metallb-updates' of github.com:egandro/k3s-ansible into fix-metallb-updates 2024-01-27 02:16:12 +01:00
Harald Fielker e7cfe8cbed use bash to allow pipefail 2024-01-27 02:16:08 +01:00
Techno Tim 6c6a2e4738 Merge branch 'master' into fix-metallb-updates 2024-01-25 10:15:07 -06:00
Techno Tim f6f661f013 Merge branch 'master' into fix-metallb-updates 2024-01-24 22:27:10 -06:00
Techno Tim 9054c279ac Merge branch 'master' into fix-metallb-updates 2024-01-19 08:37:47 -06:00
Harald Fielker 77b32ce12d added fix for metallb version upgrades 2023-11-05 02:31:29 +01:00
+21
View File
@@ -8,6 +8,27 @@
with_items: "{{ groups[group_name_master | default('master')] }}"
run_once: true
- name: Delete outdated metallb replicas
shell: |-
set -o pipefail
REPLICAS=$(k3s kubectl --namespace='metallb-system' get replicasets \
-l 'component=controller,app=metallb' \
-o jsonpath='{.items[0].spec.template.spec.containers[0].image}, {.items[0].metadata.name}' 2>/dev/null || true)
REPLICAS_SETS=$(echo ${REPLICAS} | grep -v '{{ metal_lb_controller_tag_version }}' | sed -e "s/^.*\s//g")
if [ -n "${REPLICAS_SETS}" ] ; then
for REPLICAS in "${REPLICAS_SETS}"
do
k3s kubectl --namespace='metallb-system' \
delete rs "${REPLICAS}"
done
fi
args:
executable: /bin/bash
changed_when: false
run_once: true
with_items: "{{ groups[group_name_master | default('master')] }}"
- name: Copy metallb CRs manifest to first master
template:
src: "metallb.crs.j2"