subnet dissociated

This commit is contained in:
Karim Naufal
2022-04-13 11:56:09 +02:00
parent b17f1569f2
commit 0f52a4e535
4 changed files with 17 additions and 8 deletions

13
main.tf
View File

@@ -13,7 +13,18 @@ resource "hcloud_network" "k3s" {
ip_range = local.network_ipv4_cidr
}
resource "hcloud_network_subnet" "subnet" {
# We start from the end of the subnets cird array,
# as we would have fewer control plane nodepools, than angent ones.
resource "hcloud_network_subnet" "control_plane" {
count = length(local.control_plane_nodepools)
network_id = hcloud_network.k3s.id
type = "cloud"
network_zone = var.network_region
ip_range = local.network_ipv4_subnets[255 - count.index]
}
# Here we start at the beginning of the subnets cird array
resource "hcloud_network_subnet" "agent" {
count = length(local.network_ipv4_subnets)
network_id = hcloud_network.k3s.id
type = "cloud"