2020-06-30 06:11:59 +08:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ConfigMap
|
|
|
|
metadata:
|
|
|
|
namespace: metallb-system
|
|
|
|
name: config
|
|
|
|
data:
|
|
|
|
config: |
|
2020-08-27 14:15:03 +08:00
|
|
|
{% if metallb_peers | length > 0 %}
|
2020-08-05 16:52:40 +08:00
|
|
|
peers:
|
|
|
|
{% for peer in metallb_peers %}
|
|
|
|
- peer-address: {{ peer.peer_address }}
|
|
|
|
peer-asn: {{ peer.peer_asn }}
|
|
|
|
my-asn: {{ peer.my_asn }}
|
2022-05-12 12:39:15 +08:00
|
|
|
{% if peer.password is defined %}
|
|
|
|
password: "{{ peer.password }}"
|
|
|
|
{% endif %}
|
2022-02-16 05:57:19 +08:00
|
|
|
{% if peer.source_address is defined %}
|
|
|
|
source-address: {{ peer.source_address }}
|
|
|
|
{% endif %}
|
|
|
|
{% if peer.node_selectors is defined %}
|
|
|
|
node-selectors:
|
|
|
|
{{ peer.node_selectors | to_yaml(indent=2, width=1337) | indent(8) }}
|
|
|
|
{% endif %}
|
2020-08-05 16:52:40 +08:00
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2020-06-30 06:11:59 +08:00
|
|
|
address-pools:
|
2021-10-23 00:38:39 +08:00
|
|
|
- name: {{ metallb_pool_name }}
|
2020-06-30 06:11:59 +08:00
|
|
|
protocol: {{ metallb_protocol }}
|
|
|
|
addresses:
|
|
|
|
{% for ip_range in metallb_ip_range %}
|
|
|
|
- {{ ip_range }}
|
|
|
|
{% endfor %}
|
2022-06-14 00:40:12 +08:00
|
|
|
{% if metallb_auto_assign == false %}
|
2021-11-16 21:06:27 +08:00
|
|
|
auto-assign: false
|
|
|
|
{% endif %}
|
2020-06-30 06:11:59 +08:00
|
|
|
{% if metallb_additional_address_pools is defined %}{% for pool in metallb_additional_address_pools %}
|
|
|
|
- name: {{ pool }}
|
|
|
|
protocol: {{ metallb_additional_address_pools[pool].protocol }}
|
|
|
|
addresses:
|
|
|
|
{% for ip_range in metallb_additional_address_pools[pool].ip_range %}
|
|
|
|
- {{ ip_range }}
|
|
|
|
{% endfor %}
|
|
|
|
auto-assign: {{ metallb_additional_address_pools[pool].auto_assign }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|