Verified Commit 8f5d43d4 authored by Hugo's avatar Hugo
Browse files

fix network not ready + add vg flag

parent 39b432b8
......@@ -15,6 +15,9 @@ resource "hcloud_load_balancer_network" "api_lb_net" {
load_balancer_id = hcloud_load_balancer.api_lb.id
network_id = var.network.id
ip = var.api.privateIp
depends_on = [
hcloud_network_subnet.cloudnet
]
}
resource "hcloud_load_balancer_target" "api_lb_target" {
......@@ -22,6 +25,9 @@ resource "hcloud_load_balancer_target" "api_lb_target" {
type = "label_selector"
label_selector = "cluster=${var.name},role=controller"
use_private_ip = true
depends_on = [
hcloud_network_subnet.cloudnet
]
}
resource "hcloud_load_balancer_service" "api_lb_service" {
......
......@@ -11,6 +11,9 @@ resource "hcloud_load_balancer_network" "ingress_lb_net" {
load_balancer_id = hcloud_load_balancer.ingress_lb.id
network_id = var.network.id
ip = var.ingress.privateIp
depends_on = [
hcloud_network_subnet.cloudnet
]
}
resource "hcloud_load_balancer_target" "ingress_lb_target" {
......@@ -18,6 +21,9 @@ resource "hcloud_load_balancer_target" "ingress_lb_target" {
type = "label_selector"
label_selector = "cluster=${var.name},ingress=true"
use_private_ip = true
depends_on = [
hcloud_network_subnet.cloudnet
]
}
resource "hcloud_load_balancer_service" "ingress_lb_service" {
......
......@@ -31,6 +31,11 @@ output "nodes" {
value = merge(var.nodes, {
for nodeName, node in hcloud_server.node : nodeName => merge(var.nodes[nodeName], {
"publicIp" = node.ipv4_address
"volumes" = {
for volumeName, volume in var.nodes[nodeName].volumes : volumeName => merge(volume, {
device : hcloud_volume.volume["${nodeName}:${volumeName}"].linux_device
})
}
})
})
}
......@@ -56,6 +56,7 @@ variable "nodes" {
ingress = bool
volumes = map(object({
size = number
vg = bool
}))
}))
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment