mirror of
https://github.com/optim-enterprises-bv/terraform-talos.git
synced 2025-10-29 17:42:47 +00:00
27 lines
1.2 KiB
HCL
27 lines
1.2 KiB
HCL
|
|
module "worker" {
|
|
source = "./modules/worker"
|
|
for_each = { for idx, name in local.regions : name => idx }
|
|
region = each.key
|
|
|
|
instance_count = lookup(try(var.instances[each.key], {}), "worker_count", 0)
|
|
instance_name = "worker"
|
|
instance_flavor = lookup(try(var.instances[each.key], {}), "worker_instance_type", 0)
|
|
instance_image = data.openstack_images_image_v2.talos[each.key].id
|
|
instance_tags = concat(var.tags, ["worker"])
|
|
instance_secgroups = [local.network_secgroup[each.key].common]
|
|
instance_params = merge(var.kubernetes, {
|
|
ipv4_local_network = local.network[each.key].cidr
|
|
ipv4_local_gw = local.network_private[each.key].gateway
|
|
lbv4 = module.controlplane[each.key].controlplane_lb != "" ? module.controlplane[each.key].controlplane_lb : one(local.lbv4s)
|
|
routes = "${join("\n ", formatlist("- network: %s", flatten([for zone in local.regions : local.network_subnets[zone]])))}"
|
|
})
|
|
|
|
network_internal = local.network_private[each.key]
|
|
network_external = {
|
|
id = local.network_external[each.key].id
|
|
subnet = local.network_external[each.key].subnets_v6[0]
|
|
mtu = local.network_external[each.key].mtu
|
|
}
|
|
}
|