Skip to content

Commit

Permalink
Add option to use already existing floating ips
Browse files Browse the repository at this point in the history
  • Loading branch information
haasad committed May 3, 2024
1 parent 3332396 commit 2f802b8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lb.tf
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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) : ""
Expand Down
6 changes: 3 additions & 3 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 2f802b8

Please sign in to comment.