mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2025-12-30 04:32:37 +01:00
Compare commits
5 Commits
fceaead9d3
...
6b24493f6b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b24493f6b | ||
|
|
4c0b1ee8f3 | ||
|
|
e210fc21b6 | ||
|
|
8e26ba8809 | ||
|
|
754a379d42 |
@@ -16,6 +16,9 @@ kube_vip_bgp_as: "64513"
|
||||
kube_vip_bgp_peeraddress: 192.168.30.1
|
||||
kube_vip_bgp_peeras: "64512"
|
||||
|
||||
kube_vip_bgp_peers: []
|
||||
kube_vip_bgp_peers_groups: ['k3s_master']
|
||||
|
||||
metal_lb_controller_tag_version: v0.14.3
|
||||
metal_lb_speaker_tag_version: v0.14.3
|
||||
metal_lb_type: native
|
||||
|
||||
@@ -62,6 +62,14 @@ argument_specs:
|
||||
description: Defines the AS for the kube-vip BGP peer
|
||||
default: "64512"
|
||||
|
||||
kube_vip_bgp_peers:
|
||||
description: List of BGP peer ASN & address pairs
|
||||
default: []
|
||||
|
||||
kube_vip_bgp_peers_groups:
|
||||
description: Inventory group in which to search for additional kube_vip_bgp_peers parameters to merge.
|
||||
default: ['k3s_master']
|
||||
|
||||
kube_vip_iface:
|
||||
description:
|
||||
- Explicitly define an interface that ALL control nodes
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
---
|
||||
- name: Set _kube_vip_bgp_peers fact
|
||||
ansible.builtin.set_fact:
|
||||
_kube_vip_bgp_peers: "{{ lookup('community.general.merge_variables', '^kube_vip_bgp_peers__.+$', initial_value=kube_vip_bgp_peers, groups=kube_vip_bgp_peers_groups) }}" # yamllint disable-line rule:line-length
|
||||
|
||||
- name: Create manifests directory on first master
|
||||
ansible.builtin.file:
|
||||
path: /var/lib/rancher/k3s/server/manifests
|
||||
|
||||
@@ -61,6 +61,10 @@ spec:
|
||||
- name: bgp_routerid
|
||||
value: "{{ kube_vip_bgp_routerid }}"
|
||||
{% endif %}
|
||||
{% if _kube_vip_bgp_peers | length > 0 %}
|
||||
- name: bgppeers
|
||||
value: "{{ _kube_vip_bgp_peers | map(attribute='peer_address') | zip(_kube_vip_bgp_peers| map(attribute='peer_asn')) | map('join', ',') | join(':') }}" # yamllint disable-line rule:line-length
|
||||
{% else %}
|
||||
{% if kube_vip_bgp_as is defined %}
|
||||
- name: bgp_as
|
||||
value: "{{ kube_vip_bgp_as }}"
|
||||
@@ -73,6 +77,7 @@ spec:
|
||||
- name: bgp_peeras
|
||||
value: "{{ kube_vip_bgp_peeras }}"
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
image: ghcr.io/kube-vip/kube-vip:{{ kube_vip_tag_version }}
|
||||
imagePullPolicy: Always
|
||||
|
||||
@@ -30,3 +30,4 @@ metal_lb_mode: layer2
|
||||
metal_lb_available_timeout: 240s
|
||||
metal_lb_controller_tag_version: v0.14.3
|
||||
metal_lb_ip_range: 192.168.30.80-192.168.30.90
|
||||
metal_lb_interfaces:
|
||||
|
||||
@@ -21,6 +21,13 @@ kind: L2Advertisement
|
||||
metadata:
|
||||
name: default
|
||||
namespace: metallb-system
|
||||
{% if metal_lb_interfaces %}
|
||||
spec:
|
||||
interfaces:
|
||||
{% for interface in metal_lb_interfaces %}
|
||||
- {{ interface }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if metal_lb_mode == "bgp" %}
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user