From 56b5673fd19426353ab2102fc795ee96f7435834 Mon Sep 17 00:00:00 2001 From: Ivan Rozhkov Date: Sat, 13 Nov 2021 12:00:23 +0000 Subject: [PATCH 1/3] add metallb auto-assign property for main IP range & update addons.yml for sample inventory --- inventory/sample/group_vars/k8s_cluster/addons.yml | 2 ++ roles/kubernetes-apps/metallb/defaults/main.yml | 1 + roles/kubernetes-apps/metallb/templates/metallb-config.yml.j2 | 3 +++ 3 files changed, 6 insertions(+) diff --git a/inventory/sample/group_vars/k8s_cluster/addons.yml b/inventory/sample/group_vars/k8s_cluster/addons.yml index 013f30bf6d5..ec80f84038b 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: false # 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 38e95b78ee1..80130941f96 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 \ No newline at end of file diff --git a/roles/kubernetes-apps/metallb/templates/metallb-config.yml.j2 b/roles/kubernetes-apps/metallb/templates/metallb-config.yml.j2 index 6157d63c215..7e33ce21dbb 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 }} From 4a77e6a8a265116fc8eb25746a83e2f0524b6e0d Mon Sep 17 00:00:00 2001 From: Ivan Rozhkov Date: Sat, 13 Nov 2021 12:05:57 +0000 Subject: [PATCH 2/3] add new line at the end of file roles\kubernetes-apps\metallb\defaults\main.yml --- roles/kubernetes-apps/metallb/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kubernetes-apps/metallb/defaults/main.yml b/roles/kubernetes-apps/metallb/defaults/main.yml index 80130941f96..68ba1fc09a7 100644 --- a/roles/kubernetes-apps/metallb/defaults/main.yml +++ b/roles/kubernetes-apps/metallb/defaults/main.yml @@ -19,4 +19,4 @@ metallb_speaker_tolerations: operator: Exists metallb_controller_tolerations: [] metallb_pool_name: "loadbalanced" -matallb_auto_assign: true \ No newline at end of file +matallb_auto_assign: true From 014adc03bb04d3053066a6b5f358182640926552 Mon Sep 17 00:00:00 2001 From: IKRozhkov Date: Mon, 15 Nov 2021 18:59:18 +0300 Subject: [PATCH 3/3] set default value for matallb_auto_assign = true --- inventory/sample/group_vars/k8s_cluster/addons.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventory/sample/group_vars/k8s_cluster/addons.yml b/inventory/sample/group_vars/k8s_cluster/addons.yml index ec80f84038b..66b6d45f5f7 100644 --- a/inventory/sample/group_vars/k8s_cluster/addons.yml +++ b/inventory/sample/group_vars/k8s_cluster/addons.yml @@ -140,7 +140,7 @@ metallb_speaker_enabled: true # metallb_ip_range: # - "10.5.0.50-10.5.0.99" # metallb_pool_name: "loadbalanced" -# matallb_auto_assign: false +# matallb_auto_assign: true # metallb_speaker_nodeselector: # kubernetes.io/os: "linux" # metallb_controller_nodeselector: