added a default subnet for the lb to use and not usurp node subnets
This commit is contained in:
parent
ed23ba3735
commit
7f11b21d46
10
main.tf
10
main.tf
@ -13,12 +13,22 @@ resource "hcloud_network" "k3s" {
|
||||
ip_range = var.network_ipv4_range
|
||||
}
|
||||
|
||||
# This is the default subnet to be used by the load balancer.
|
||||
resource "hcloud_network_subnet" "default" {
|
||||
network_id = hcloud_network.k3s.id
|
||||
type = "cloud"
|
||||
network_zone = var.network_region
|
||||
ip_range = "10.0.0.0/16"
|
||||
}
|
||||
|
||||
resource "hcloud_network_subnet" "subnet" {
|
||||
for_each = var.network_ipv4_subnets
|
||||
network_id = hcloud_network.k3s.id
|
||||
type = "cloud"
|
||||
network_zone = var.network_region
|
||||
ip_range = each.value
|
||||
|
||||
depends_on = [hcloud_network_subnet.default]
|
||||
}
|
||||
|
||||
resource "hcloud_firewall" "k3s" {
|
||||
|
Loading…
Reference in New Issue
Block a user