-
Notifications
You must be signed in to change notification settings - Fork 11
/
metallb.tf
30 lines (26 loc) · 783 Bytes
/
metallb.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module "metallb" {
source = "github.com/colinwilson/terraform-kubernetes-metallb?ref=0.1.6"
// We want the MetalLB controller running on the control plane
controller_toleration = [local.control-plane-toleration]
controller_node_selector = local.control-plane-node-selector
}
resource "kubernetes_config_map" "metallb_config" {
metadata {
name = "config"
namespace = "metallb-system"
}
// Change this to fit your needs!
data = {
config = yamlencode({
address-pools = [
{
name = "default"
protocol = "layer2"
addresses = ["192.168.57.100-192.168.57.254"]
}
]
})
}
// This is required because the module creates the metallb-system namespace
depends_on = [module.metallb]
}