Role definition for installing MetalLB.
├── roles
│ ├── metallb-install
| | ├── defaults
| | | ├── main.yml
| | ├── tasks
| | | ├── main.yml
| | ├── templates
| | | ├── metallb-config.yml.j2
Ansible Role definition for installing MetalLB, a load-balancer implementation for bare metal Kubernetes clusters.
We will use MetalLB in Layer-2 mode.
In layer 2 mode, one node assumes the responsibility of advertising a service to the local network. From the network’s perspective, it simply looks like that machine has multiple IP addresses assigned to its network interface.
All traffic for a service IP goes to one node. From there, kube-proxy spreads the traffic to all the service’s pods.
In that sense, layer 2 does not implement a load balancer. Rather, it implements a failover mechanism so that a different node can take over should the current leader node fail for some reason.
This role does the following:
- Creates a namespace for the MetalLB deployment.
- Deploys the MetalLB Helm chart.
- Configures the CRD's:
https://metallb.universe.tf/installation/ https://picluster.ricsanfre.com/docs/metallb/