From 7919a4716594d082b17896fd9e5aac0b60cf6af7 Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 22 Sep 2023 05:29:49 +0200 Subject: [PATCH] [metallb] add config option for IPAddressPool avoidBuggyIPs (#10458) * Add avoid_buggy_ips as optional * Revert avoid_buggy_ips default back to false * Change auto_assign to optional, default true --- docs/metallb.md | 5 ++--- roles/kubernetes-apps/metallb/templates/pools.yaml.j2 | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/metallb.md b/docs/metallb.md index 4a577b084..94b81fa27 100644 --- a/docs/metallb.md +++ b/docs/metallb.md @@ -73,7 +73,6 @@ metallb_config: primary: ip_range: - 192.0.1.0-192.0.1.254 - auto_assign: true pool1: ip_range: @@ -82,8 +81,8 @@ metallb_config: pool2: ip_range: - - 192.0.2.2-192.0.2.2 - auto_assign: false + - 192.0.3.0/24 + avoid_buggy_ips: true # When set to true, .0 and .255 addresses will be avoided. ``` ## Layer2 Mode diff --git a/roles/kubernetes-apps/metallb/templates/pools.yaml.j2 b/roles/kubernetes-apps/metallb/templates/pools.yaml.j2 index 73a569f51..f22a4e3d1 100644 --- a/roles/kubernetes-apps/metallb/templates/pools.yaml.j2 +++ b/roles/kubernetes-apps/metallb/templates/pools.yaml.j2 @@ -16,7 +16,7 @@ spec: {% for ip_range in pool.ip_range %} - "{{ ip_range }}" {% endfor %} - autoAssign: {{ pool.auto_assign }} - avoidBuggyIPs: true + autoAssign: {{ pool.auto_assign | default(true) }} + avoidBuggyIPs: {{ pool.avoid_buggy_ips | default(false) }} {% endfor %}