Skip to content

Commit

Permalink
Add support to override the default internal VIP and provide an inter…
Browse files Browse the repository at this point in the history
…nal router VIP
  • Loading branch information
simu committed Jul 17, 2024
1 parent d282a49 commit 69fd4f6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module "lb" {
bootstrap_node = var.bootstrap_count > 0 ? cidrhost(local.privnet_cidr, 10) : ""
lb_cloudscale_api_secret = var.lb_cloudscale_api_secret
hieradata_repo_user = var.hieradata_repo_user
internal_vip = cidrhost(local.privnet_cidr, 100)
internal_vip = local.internal_vip
internal_router_vip = var.internal_router_vip
enable_proxy_protocol = var.lb_enable_proxy_protocol
}
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ locals {
privnet_uuid = local.create_privnet_subnet > 0 ? cloudscale_network.privnet[0].id : data.cloudscale_subnet.privnet_subnet[0].network_uuid
privnet_cidr = local.create_privnet_subnet > 0 ? var.privnet_cidr : data.cloudscale_subnet.privnet_subnet[0].cidr
worker_volume_size_gb = var.worker_volume_size_gb == 0 ? var.default_volume_size_gb : var.worker_volume_size_gb
internal_vip = var.internal_vip != "" ? var.internal_vip : cidrhost(local.privnet_cidr, 100)
}

resource "cloudscale_network" "privnet" {
Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,15 @@ variable "enable_nat_vip" {
description = "Whether to configure a cloudscale floating IP for the default gateway NAT"
default = true
}

variable "internal_vip" {
type = string
description = "Custom internal floating IP for the API. Users must provide an IP that's within the final privnet CIDR."
default = ""
}

variable "internal_router_vip" {
type = string
description = "Custom internal floating IP for the router. Users must provide an IP that's within the final privnet CIDR."
default = ""
}

0 comments on commit 69fd4f6

Please sign in to comment.