metallb: fix for kubernetes running without kube-proxy

This commit is contained in:
ace 2023-09-12 23:24:02 +03:00
parent 0bff6e9a26
commit 5f333565a3
Signed by: ace
GPG Key ID: 2C08973DD37A76FD

View File

@ -11,15 +11,25 @@
release_values: "{{ metallb_combined_values | from_yaml }}" release_values: "{{ metallb_combined_values | from_yaml }}"
wait: true wait: true
- name: Check if kube-proxy ConfigMap exist
check_mode: false
shell: |
kubectl get configmap kube-proxy -n kube-system
register: _kube_proxy_configmap
failed_when: false
changed_when: false
- name: Check for strict arp - name: Check for strict arp
check_mode: false check_mode: false
shell: | shell: |
kubectl get configmap kube-proxy -n kube-system -o yaml | \ kubectl get configmap kube-proxy -n kube-system -o yaml | \
sed -e "s/strictARP: false/strictARP: true/" | \ sed -e "s/strictARP: false/strictARP: true/" | \
kubectl diff -f - -n kube-system kubectl diff -f - -n kube-system
register: check_strict_arp register: check_strict_arp_status
when: metallb_strict_arp when:
changed_when: check_strict_arp.rc != 0 - _kube_proxy_configmap.rc == 0
- metallb_strict_arp
changed_when: check_strict_arp_status.rc != 0
- name: Apply strict arp - name: Apply strict arp
shell: | shell: |
@ -28,8 +38,9 @@
kubectl apply -f - -n kube-system \ kubectl apply -f - -n kube-system \
&& kubectl -n kube-system delete pods --selector=k8s-app=kube-proxy && kubectl -n kube-system delete pods --selector=k8s-app=kube-proxy
when: when:
- strict_arp_for_metallb - _kube_proxy_configmap.rc == 0
- metallb_strict_arp.changed - metallb_strict_arp
- metallb_strict_arp_status.changed
- name: Apply MetalLB L2 definitions - name: Apply MetalLB L2 definitions
k8s: k8s: