Skip to content

Commit

Permalink
Allow setting 'auto-assign' property to 'false' for default IP pool (…
Browse files Browse the repository at this point in the history
…Metallb addon) (kubernetes-sigs#8193)

* add metallb auto-assign property for main IP range & update addons.yml for sample inventory

* add new line at the end of file roles\kubernetes-apps\metallb\defaults\main.yml

* set default value for matallb_auto_assign = true
  • Loading branch information
ikrozhkov authored and LuckySB committed Jun 28, 2023
1 parent 45b3f12 commit 9fbd3d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions inventory/sample/group_vars/k8s_cluster/addons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions roles/kubernetes-apps/metallb/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ metallb_speaker_tolerations:
operator: Exists
metallb_controller_tolerations: []
metallb_pool_name: "loadbalanced"
matallb_auto_assign: true
3 changes: 3 additions & 0 deletions roles/kubernetes-apps/metallb/templates/metallb-config.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 9fbd3d7

Please sign in to comment.