Syntax fixes
This commit is contained in:
parent
3bf2d848a4
commit
77555d15d2
2 changed files with 48 additions and 24 deletions
|
@ -11,15 +11,41 @@ metadata:
|
||||||
name: "{{ community_name }}"
|
name: "{{ community_name }}"
|
||||||
namespace: "{{ namespace_name }}"
|
namespace: "{{ namespace_name }}"
|
||||||
spec:
|
spec:
|
||||||
community:
|
communities:
|
||||||
- name: "{{ community_name }}"
|
- name: "{{ community_name }}"
|
||||||
value: "{{ community }}"
|
value: "{{ community }}"
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: metallb.io/v1beta1
|
||||||
|
kind: Community
|
||||||
|
metadata:
|
||||||
|
name: well-known
|
||||||
|
namespace: "{{ namespace_name }}"
|
||||||
|
spec:
|
||||||
|
communities:
|
||||||
|
- name: no-export
|
||||||
|
value: 65535:65281
|
||||||
|
- name: no-advertise
|
||||||
|
value: 65535:65282
|
||||||
|
- name: local-as
|
||||||
|
value: 65535:65283
|
||||||
|
- name: nopeer
|
||||||
|
value: 65535:65284
|
||||||
|
|
||||||
|
# BGPAdvertisement is used to advertise address pools to the BGP peer. Specific pools can be listed to be advertised.
|
||||||
|
# Local BGP Advertisement specifies that the IP specified in the address pool will be used as remote source address for traffic entering your cluster from the remote peer.
|
||||||
|
# When using this option, be sure to use a subnet and routable IP for your address pool.
|
||||||
|
# This is good: 10.0.0.10/24. This is also good: 10.0.0.129/25. This is bad: 10.0.0.0/24. This is also bad: 10.0.0.128/25.
|
||||||
|
# In this example, 10.0.0.10 will be used as the remote source address.
|
||||||
|
# This is also bad: 10.0.0.10-10.0.0.25. Remember: you are working with aggregationLength, which specifies a subnet, not an IP range!
|
||||||
|
# The no-advertise community is set on the local advertisement to prevent this route from being published to the BGP peer.
|
||||||
|
# Your aggregationLength ideally is the same size as your address pool.
|
||||||
|
|
||||||
{% for peer_name, peer in metallb_config.layer3.metallb_peers.items() %}
|
{% for peer_name, peer in metallb_config.layer3.metallb_peers.items() %}
|
||||||
|
|
||||||
# BGPAdvertisement is used to advertise the specified address pool to the BGP peer.
|
{% if peer.aggregation_length is defined and peer.aggregation_length <= 30 %}
|
||||||
# Local BGP Advertisement specifies that the IP specified in the address pool will be used as source address for traffic entering your cluster from the remote peer.
|
|
||||||
---
|
---
|
||||||
apiVersion: metallb.io/v1beta1
|
apiVersion: metallb.io/v1beta1
|
||||||
kind: BGPAdvertisement
|
kind: BGPAdvertisement
|
||||||
|
@ -27,21 +53,19 @@ metadata:
|
||||||
name: "{{ peer_name }}-local"
|
name: "{{ peer_name }}-local"
|
||||||
namespace: "{{ namespace_name }}"
|
namespace: "{{ namespace_name }}"
|
||||||
spec:
|
spec:
|
||||||
|
aggregationLength: 32
|
||||||
|
aggregationLengthV6: 128
|
||||||
|
communities:
|
||||||
|
- no-advertise
|
||||||
|
localpref: "{{ peer.localpref | default ("100") }}"
|
||||||
ipAddressPools:
|
ipAddressPools:
|
||||||
{% for address_pool in peer.address_pool %}
|
{% for address_pool in peer.address_pool %}
|
||||||
- "{{ address_pool }}"
|
- "{{ address_pool }}"
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if peer.advanced | length > 0 %}
|
|
||||||
aggregationLength: 32
|
|
||||||
localpref: "{{ peer.localpref | default ("100") }}"
|
|
||||||
communities:
|
|
||||||
{% for community in peer.communities %}
|
|
||||||
- "{{ community }}"
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
# External GBP Advertisement. The IP range specied in the address pool is advertized to the BGP peer.
|
# External BGP Advertisement. The IP range specied in the address pool is advertised to the BGP peer.
|
||||||
---
|
---
|
||||||
apiVersion: metallb.io/v1beta1
|
apiVersion: metallb.io/v1beta1
|
||||||
kind: BGPAdvertisement
|
kind: BGPAdvertisement
|
||||||
|
@ -49,16 +73,22 @@ metadata:
|
||||||
name: "{{ peer_name }}-external"
|
name: "{{ peer_name }}-external"
|
||||||
namespace: "{{ namespace_name }}"
|
namespace: "{{ namespace_name }}"
|
||||||
spec:
|
spec:
|
||||||
|
{% if peer.aggregation_length is defined and peer.aggregation_length <= 30 %}
|
||||||
|
aggregationLength: {{ peer.aggregation_length }}
|
||||||
|
{% endif %}
|
||||||
ipAddressPools:
|
ipAddressPools:
|
||||||
{% for address_pool in peer.address_pool %}
|
{% for address_pool in peer.address_pool %}
|
||||||
- "{{ address_pool }}"
|
- "{{ address_pool }}"
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if peer.advanced | length > 0 %}
|
{% if peer.communities is defined %}
|
||||||
aggregationLength: "{{ peer.aggregation_length }}"
|
{% for community in peer.communities %}
|
||||||
|
communities:
|
||||||
|
- "{{ community }}"
|
||||||
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
# Configuration for the GBP peer.
|
# Configuration for the BGP peer.
|
||||||
---
|
---
|
||||||
apiVersion: metallb.io/v1beta2
|
apiVersion: metallb.io/v1beta2
|
||||||
kind: BGPPeer
|
kind: BGPPeer
|
||||||
|
@ -86,18 +116,12 @@ spec:
|
||||||
|
|
||||||
{% if peer.hold_time is defined %}
|
{% if peer.hold_time is defined %}
|
||||||
holdTime: {{ peer.hold_time }}
|
holdTime: {{ peer.hold_time }}
|
||||||
{% else %}
|
{% elif metallb_config.layer3.defaults.hold_time is defined %}
|
||||||
holdTime: {{ metallb_config.layer3.defaults.hold_time }}
|
holdTime: {{ metallb_config.layer3.defaults.hold_time }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if peer.keepalive_time is defined %}
|
|
||||||
keepaliveTime: {{ peer.keepalive_time }}
|
|
||||||
{% else %}
|
|
||||||
keepaliveTime: {{ metallb_config.layer3.defaults.keepalive_time }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if peer.multihop is defined %}
|
{% if peer.multihop is defined %}
|
||||||
elayer3MultiHop: "{{ peer.multihop }}"
|
ebgpMultiHop: {{ peer.multihop }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -16,7 +16,7 @@ spec:
|
||||||
addresses:
|
addresses:
|
||||||
- "{{ ip_range }}"
|
- "{{ ip_range }}"
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
auto-assign: "{{ pool.auto_assign }}"
|
autoAssign: {{ pool.auto_assign }}
|
||||||
avoidBuggyIPs: true
|
avoidBuggyIPs: true
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in a new issue