diff --git a/agents.tf b/agents.tf index 10912ec..3e23079 100644 --- a/agents.tf +++ b/agents.tf @@ -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" diff --git a/control_planes.tf b/control_planes.tf index 34cf4bf..440dc3a 100644 --- a/control_planes.tf +++ b/control_planes.tf @@ -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",