mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2026-09-14 08:03:19 +02:00
feat(k3s-server): add kube_vip_enabled and metal_lb_enabled switches
- gate the control-plane VIP and kube-vip service LB on kube_vip_enabled - gate the MetalLB manifest and pool on metal_lb_enabled - add argument_specs entries in both roles - document both switches in sample inventory and README - update metal_lb deploy-condition test and add a kube-vip deploy-condition test
This commit is contained in:
committed by
Techno Tim
parent
4dc333a7d3
commit
1687a3b098
@@ -20,6 +20,9 @@ kube_vip_bgp_peeras: "64512"
|
||||
kube_vip_bgp_peers: []
|
||||
kube_vip_bgp_peers_groups: ['k3s_master']
|
||||
|
||||
kube_vip_enabled: true
|
||||
|
||||
metal_lb_enabled: true
|
||||
metal_lb_controller_tag_version: v0.16.0
|
||||
metal_lb_speaker_tag_version: v0.16.0
|
||||
metal_lb_type: native
|
||||
|
||||
@@ -95,10 +95,25 @@ argument_specs:
|
||||
description: Tag for kube-vip-cloud-provider manifest when enabled
|
||||
default: v0.0.12
|
||||
|
||||
kube_vip_enabled:
|
||||
description:
|
||||
- Enable installing kube-vip.
|
||||
- Covers both the control-plane VIP and the service load balancer.
|
||||
- Set false to skip kube-vip entirely, for example on a single node or when an external load balancer is used.
|
||||
default: true
|
||||
type: bool
|
||||
|
||||
kube_vip_lb_ip_range:
|
||||
description: IP range for kube-vip load balancer
|
||||
default: ~
|
||||
|
||||
metal_lb_enabled:
|
||||
description:
|
||||
- Enable installing MetalLB for service load balancing.
|
||||
- Set false to skip MetalLB, for example when an external load balancer is used.
|
||||
default: true
|
||||
type: bool
|
||||
|
||||
metal_lb_controller_tag_version:
|
||||
description: Image tag for MetalLB
|
||||
default: v0.16.0
|
||||
|
||||
@@ -24,19 +24,21 @@
|
||||
|
||||
- name: Deploy vip manifest
|
||||
ansible.builtin.include_tasks: vip.yml
|
||||
when: kube_vip_enabled
|
||||
- name: Deploy metallb manifest
|
||||
ansible.builtin.include_tasks: metallb.yml
|
||||
tags: metallb
|
||||
# Deploy MetalLB unless kube-vip owns the load balancer IP range, or Cilium
|
||||
# BGP is enabled (Cilium then provides its own load balancing). The cilium_bgp
|
||||
# default keeps this safe when Cilium variables are not in scope at all (#644)
|
||||
# while still deploying MetalLB when a non-BGP Cilium CNI is in use.
|
||||
when: kube_vip_lb_ip_range is not defined and not (cilium_bgp | default(false) | bool)
|
||||
# Deploy MetalLB unless explicitly disabled, kube-vip owns the load balancer
|
||||
# IP range, or Cilium BGP is enabled (Cilium then provides its own load
|
||||
# balancing). The cilium_bgp default keeps this safe when Cilium variables are
|
||||
# not in scope at all (#644) while still deploying MetalLB when a non-BGP
|
||||
# Cilium CNI is in use.
|
||||
when: metal_lb_enabled and kube_vip_lb_ip_range is not defined and not (cilium_bgp | default(false) | bool)
|
||||
|
||||
- name: Deploy kube-vip manifest
|
||||
ansible.builtin.include_tasks: kube-vip.yml
|
||||
tags: kubevip
|
||||
when: kube_vip_lb_ip_range is defined
|
||||
when: kube_vip_enabled and kube_vip_lb_ip_range is defined
|
||||
|
||||
- name: Initialize and verify the K3s control plane
|
||||
any_errors_fatal: true
|
||||
|
||||
Reference in New Issue
Block a user