Fix LB IP collision for good

This commit is contained in:
Karim Naufal 2022-03-06 00:59:19 +01:00
parent 7f11b21d46
commit 2ae2c0dc41
2 changed files with 9 additions and 2 deletions

View File

@ -13,7 +13,11 @@ module "agents" {
location = var.location
server_type = each.value.server_type
ipv4_subnet_id = hcloud_network_subnet.subnet[each.value.subnet].id
private_ipv4 = cidrhost(var.network_ipv4_subnets[each.value.subnet], each.value.index + 1)
# We leave some room so 100 eventual Hetzner LBs that can be created perfectly safely
# It leaves the subnet with 254 x 254 - 100 = 64416 IPs to use, so probably enough.
private_ipv4 = cidrhost(var.network_ipv4_subnets[each.value.subnet], each.value.index + 101)
labels = {
"provisioner" = "terraform",
"engine" = "k3s"

View File

@ -13,7 +13,10 @@ module "control_planes" {
location = var.location
server_type = var.control_plane_server_type
ipv4_subnet_id = hcloud_network_subnet.subnet["control_plane"].id
private_ipv4 = cidrhost(var.network_ipv4_subnets["control_plane"], count.index + 1)
# We leave some room so 100 eventual Hetzner LBs that can be created perfectly safely
# It leaves the subnet with 254 x 254 - 100 = 64416 IPs to use, so probably enough.
private_ipv4 = cidrhost(var.network_ipv4_subnets["control_plane"], count.index + 101)
labels = {
"provisioner" = "terraform",