add specific subnet for nodepool

This commit is contained in:
jodhi
2022-02-26 01:16:38 +07:00
parent b5039e2bc1
commit c9101824fc
10 changed files with 62 additions and 31 deletions

View File

@@ -11,8 +11,9 @@ module "control_planes" {
firewall_ids = [hcloud_firewall.k3s.id]
placement_group_id = hcloud_placement_group.k3s.id
location = var.location
network_id = hcloud_network.k3s.id
server_type = var.control_plane_server_type
subnet_id = hcloud_network_subnet.subnet["control_plane"].id
private_ip = cidrhost(var.network_subnets["control_plane"], count.index + 1)
labels = {
"provisioner" = "terraform",
@@ -20,6 +21,10 @@ module "control_planes" {
}
hcloud_token = var.hcloud_token
depends_on = [
hcloud_network_subnet.subnet
]
}
resource "null_resource" "control_planes" {
@@ -78,6 +83,6 @@ resource "null_resource" "control_planes" {
depends_on = [
null_resource.first_control_plane,
hcloud_network_subnet.k3s
hcloud_network_subnet.subnet
]
}