From 8acf1a538dbde84c4373d53fcebed137f00275db Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Rodriguez Date: Thu, 9 Jan 2025 16:25:09 +0100 Subject: [PATCH 1/2] Update l2advertisement.yaml.j2 --- .../ocp4_workload_metallb/templates/l2advertisement.yaml.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansible/roles_ocp_workloads/ocp4_workload_metallb/templates/l2advertisement.yaml.j2 b/ansible/roles_ocp_workloads/ocp4_workload_metallb/templates/l2advertisement.yaml.j2 index c5c80c79082..25635ee9fdb 100644 --- a/ansible/roles_ocp_workloads/ocp4_workload_metallb/templates/l2advertisement.yaml.j2 +++ b/ansible/roles_ocp_workloads/ocp4_workload_metallb/templates/l2advertisement.yaml.j2 @@ -6,3 +6,7 @@ metadata: spec: ipAddressPools: {{ ocp4_workload_metallb_l2advertisement_ipaddresspool | to_yaml }} interfaces: {{ ocp4_workload_metallb_l2advertisement_interface | to_yaml }} + {% if ocp4_workload_metallb_node_selector | default("") | length > 0 %} +nodeSelectors: + {{ ocp4_workload_metallb_node_selector | to_yaml }} + {% endif %} From 8ef2081facea23fb8c77586997b2672d3de7dec9 Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Rodriguez Date: Thu, 9 Jan 2025 16:28:39 +0100 Subject: [PATCH 2/2] Update main.yml --- .../ocp4_workload_metallb/defaults/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansible/roles_ocp_workloads/ocp4_workload_metallb/defaults/main.yml b/ansible/roles_ocp_workloads/ocp4_workload_metallb/defaults/main.yml index 22b2db6a8a1..35375826e38 100644 --- a/ansible/roles_ocp_workloads/ocp4_workload_metallb/defaults/main.yml +++ b/ansible/roles_ocp_workloads/ocp4_workload_metallb/defaults/main.yml @@ -57,3 +57,7 @@ ocp4_workload_metallb_l2advertisement_ipaddresspool: - "ip-addresspool" ocp4_workload_metallb_l2advertisement_interface: - "br-ex" + +# By default, MetalLB advertises in all nodes. This variable is used to specify in which nodes should be advertised + +ocp4_workload_metallb_node_selector: ""