From 2f802b8f9420ed2edfc9bcd0d56004601efe6589 Mon Sep 17 00:00:00 2001 From: haasad Date: Fri, 26 Apr 2024 13:38:29 +0200 Subject: [PATCH] Add option to use already existing floating ips --- lb.tf | 3 ++- outputs.tf | 6 +++--- variables.tf | 6 ++++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lb.tf b/lb.tf index 547db05..ee3e403 100644 --- a/lb.tf +++ b/lb.tf @@ -1,5 +1,5 @@ module "lb" { - source = "git::https://github.com/appuio/terraform-modules.git//modules/vshn-lbaas-cloudscale?ref=v5.1.0" + source = "git::https://github.com/appuio/terraform-modules.git//modules/vshn-lbaas-cloudscale?ref=v6.1.0" node_name_suffix = local.node_name_suffix cluster_id = var.cluster_id @@ -11,6 +11,7 @@ module "lb" { control_vshn_net_token = var.control_vshn_net_token team = var.team additional_networks = var.additional_lb_networks + use_existing_vips = var.use_existing_vips router_backends = module.infra.ip_addresses[*] bootstrap_node = var.bootstrap_count > 0 ? cidrhost(var.privnet_cidr, 10) : "" diff --git a/outputs.tf b/outputs.tf index 5a65d7a..5cc8eec 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,9 +1,9 @@ output "dns_entries" { value = templatefile("${path.module}/templates/dns.zone", { "node_name_suffix" = local.node_name_suffix, - "api_vip" = var.lb_count != 0 ? split("/", module.lb.api_vip[0].network)[0] : "" - "router_vip" = var.lb_count != 0 ? split("/", module.lb.router_vip[0].network)[0] : "" - "egress_vip" = var.lb_count != 0 ? split("/", module.lb.nat_vip[0].network)[0] : "" + "api_vip" = var.lb_count != 0 ? split("/", module.lb.api_vip.network)[0] : "" + "router_vip" = var.lb_count != 0 ? split("/", module.lb.router_vip.network)[0] : "" + "egress_vip" = var.lb_count != 0 ? split("/", module.lb.nat_vip.network)[0] : "" "internal_vip" = cidrhost(local.privnet_cidr, 100), "masters" = module.master.ip_addresses, "cluster_id" = var.cluster_id, diff --git a/variables.tf b/variables.tf index ccf95e0..ff52e6e 100644 --- a/variables.tf +++ b/variables.tf @@ -169,3 +169,9 @@ variable "lb_enable_proxy_protocol" { description = "Enable the PROXY protocol on the loadbalancers. WARNING: Connections will fail until you enable the same on the OpenShift router as well" default = false } + +variable "use_existing_vips" { + type = bool + description = "Use existing floating IPs for api_vip, router_vip and nat_vip. Manually set the reverse DNS info, so the correct data source is found." + default = false +}