diff --git a/inventory/sample/group_vars/k8s_cluster/addons.yml b/inventory/sample/group_vars/k8s_cluster/addons.yml index 013f30bf6..66b6d45f5 100644 --- a/inventory/sample/group_vars/k8s_cluster/addons.yml +++ b/inventory/sample/group_vars/k8s_cluster/addons.yml @@ -139,6 +139,8 @@ metallb_enabled: false metallb_speaker_enabled: true # metallb_ip_range: # - "10.5.0.50-10.5.0.99" +# metallb_pool_name: "loadbalanced" +# matallb_auto_assign: true # metallb_speaker_nodeselector: # kubernetes.io/os: "linux" # metallb_controller_nodeselector: diff --git a/roles/kubernetes-apps/metallb/defaults/main.yml b/roles/kubernetes-apps/metallb/defaults/main.yml index 38e95b78e..68ba1fc09 100644 --- a/roles/kubernetes-apps/metallb/defaults/main.yml +++ b/roles/kubernetes-apps/metallb/defaults/main.yml @@ -19,3 +19,4 @@ metallb_speaker_tolerations: operator: Exists metallb_controller_tolerations: [] metallb_pool_name: "loadbalanced" +matallb_auto_assign: true diff --git a/roles/kubernetes-apps/metallb/templates/metallb-config.yml.j2 b/roles/kubernetes-apps/metallb/templates/metallb-config.yml.j2 index 6157d63c2..7e33ce21d 100644 --- a/roles/kubernetes-apps/metallb/templates/metallb-config.yml.j2 +++ b/roles/kubernetes-apps/metallb/templates/metallb-config.yml.j2 @@ -21,6 +21,9 @@ data: {% for ip_range in metallb_ip_range %} - {{ ip_range }} {% endfor %} +{% if matallb_auto_assign == false %} + auto-assign: false +{% endif %} {% if metallb_additional_address_pools is defined %}{% for pool in metallb_additional_address_pools %} - name: {{ pool }} protocol: {{ metallb_additional_address_pools[pool].protocol }}