Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add BGP as an option for the Kube_VIP #140

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions roles/kube_vip/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,24 @@ kube_vip_interface: "{{ keepalived_interface | default(kubernetes_keepalived_int

# IP address to use for kube-vip
kube_vip_address: "{{ keepalived_vip | default(kubernetes_keepalived_vip) }}"

# use bgp for kube-vip
kube_vip_mode: arp

# BGP peers, if BGP is enabled
# kube_vip_bgp_peers: 192.168.0.10:65000::false,192.168.0.11:65000::false

# BGP peer as, if BGP is enabled
# kube_vip_bgp_peeras: "65000"

# AS of a single BGP Peer, if BGP is enabled
# kube_vip_bgp_as: "65000"

# BGP router id, if BGP is enabled
# kube_vip_bgp_routerid: 192.168.0.2

# Address of a single BGP Peer, if BGP is enabled
# kube_vip_bgp_peeraddress:

# password to work with a single BGP Peer, if BGP is enabled
# kube_vip_bgp_peerpass:
19 changes: 19 additions & 0 deletions roles/kube_vip/templates/kube-vip.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spec:
value: kube-system
- name: vip_ddns
value: "false"
{% if kube_vip_mode == "arp" %}
- name: svc_enable
value: "true"
- name: svc_leasename
Expand All @@ -37,6 +38,24 @@ spec:
value: "10"
- name: vip_retryperiod
value: "2"
{% elif kube_vip_mode == "bgp" %}
- name: bgp_enable
value: "true"
- name: bgp_routerid
value: "{{ kube_vip_bgp_routerid }}"
- name: bgp_as
value: "{{ kube_vip_bgp_as }}"
- name: bgp_peeraddress
value: "{{ kube_vip_bgp_peeraddress }}"
- name: bgp_peerpass
value: "{{ kube_vip_bgp_peerpass}}"
- name: bgp_peeras
value: "{{ kube_vip_bgp_peeras }}"
- name: bgp_peers
value: "{{ kube_vip_bgp_peers }}"
- name: address
value: "{{ kube_vip_address }}"
{% endif %}
- name: address
value: "{{ kube_vip_address }}"
- name: prometheus_server
Expand Down