diff --git a/roles/kubernetes-apps/metallb/defaults/main.yml b/roles/kubernetes-apps/metallb/defaults/main.yml index 22e2935b25f..02f4e3cae94 100644 --- a/roles/kubernetes-apps/metallb/defaults/main.yml +++ b/roles/kubernetes-apps/metallb/defaults/main.yml @@ -13,3 +13,4 @@ metallb_speaker_tolerations: key: node-role.kubernetes.io/control-plane operator: Exists metallb_controller_tolerations: [] +metallb_loadbalancer_class: "" \ No newline at end of file diff --git a/roles/kubernetes-apps/metallb/templates/metallb.yaml.j2 b/roles/kubernetes-apps/metallb/templates/metallb.yaml.j2 index eab386ff8f8..608ad31cda4 100644 --- a/roles/kubernetes-apps/metallb/templates/metallb.yaml.j2 +++ b/roles/kubernetes-apps/metallb/templates/metallb.yaml.j2 @@ -1724,6 +1724,9 @@ spec: - args: - --port={{ metallb_port }} - --log-level={{ metallb_log_level }} +{% if metallb_loadbalancer_class != "" %} + - --lb-class={{ metallb_loadbalancer_class }} +{% endif %} env: - name: METALLB_ML_SECRET_NAME value: memberlist @@ -1814,6 +1817,9 @@ spec: - args: - --port={{ metallb_port }} - --log-level={{ metallb_log_level }} +{% if metallb_loadbalancer_class != "" %} + - --lb-class={{ metallb_loadbalancer_class }} +{% endif %} env: - name: METALLB_NODE_NAME valueFrom: