mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-09 11:47:47 +03:00
Update MetalLB and switch to CRD notation. (#9120)
Signed-off-by: Jeroen Rijken <jeroen.rijken@xs4all.nl>
This commit is contained in:
@@ -15,8 +15,8 @@
|
||||
fail:
|
||||
msg: "metallb_peers is mandatory when metallb_protocol is bgp and metallb_speaker_enabled"
|
||||
when:
|
||||
- metallb_protocol == 'bgp' and metallb_speaker_enabled
|
||||
- metallb_peers is not defined or not metallb_peers
|
||||
- metallb_config.layer3 is defined and metallb_speaker_enabled
|
||||
- metallb_config.metallb_peers is not defined or not metallb_config.metallb_peers
|
||||
|
||||
- name: Kubernetes Apps | Check that the deprecated 'matallb_auto_assign' variable is not used anymore
|
||||
fail:
|
||||
@@ -45,11 +45,29 @@
|
||||
src: "{{ item }}.j2"
|
||||
dest: "{{ kube_config_dir }}/{{ item }}"
|
||||
mode: 0644
|
||||
with_items: ["metallb.yml", "metallb-config.yml"]
|
||||
with_items: ["metallb.yml", "metallb-config.yml", "pools.yaml", "layer2.yaml", "layer3.yaml"]
|
||||
register: "rendering"
|
||||
when:
|
||||
- "inventory_hostname == groups['kube_control_plane'][0]"
|
||||
|
||||
- name: Kubernetes Apps | Create MetalLB resources and replace existing
|
||||
k8s:
|
||||
definition: "{{ lookup('template', 'metallb.yaml') }}"
|
||||
|
||||
- name: Kubernetes Apps | Wait for MetalLB controller to be running
|
||||
k8s_info:
|
||||
kind: Deployment
|
||||
namespace: metallb-system
|
||||
name: controller
|
||||
wait: True
|
||||
wait_sleep: 10
|
||||
wait_timeout: 360
|
||||
wait_condition:
|
||||
status: "True"
|
||||
type: Available
|
||||
register: result
|
||||
until: result is not failed
|
||||
|
||||
- name: Kubernetes Apps | Install and configure MetalLB
|
||||
kube:
|
||||
name: "MetalLB"
|
||||
@@ -60,3 +78,10 @@
|
||||
with_items: "{{ rendering.results }}"
|
||||
when:
|
||||
- "inventory_hostname == groups['kube_control_plane'][0]"
|
||||
|
||||
- name: Kubernetes Apps | Delete MetalLB ConfigMap
|
||||
k8s:
|
||||
name: config
|
||||
kind: ConfigMap
|
||||
namespace: metallb-system
|
||||
state: absent
|
||||
|
||||
Reference in New Issue
Block a user