Skip to content

Commit

Permalink
Merge pull request #56 from appuio/cloudscale/internal-router-vip
Browse files Browse the repository at this point in the history
vshn-lbaas-cloudscale: Add variable to configure an internal router VIP
  • Loading branch information
simu authored Jul 17, 2024
2 parents 5bafe85 + 7a0cb7f commit 157dde2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 12 deletions.
1 change: 1 addition & 0 deletions modules/vshn-lbaas-cloudscale/hiera.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module "hiera" {
hieradata_repo_user = var.hieradata_repo_user
api_vip = var.enable_api_vip ? cidrhost(local.api_vip[0].network, 0) : ""
internal_vip = var.internal_vip
internal_router_vip = var.internal_router_vip
nat_vip = var.enable_nat_vip ? cidrhost(local.nat_vip[0].network, 0) : ""
router_vip = var.enable_router_vip ? cidrhost(local.router_vip[0].network, 0) : ""
team = var.team
Expand Down
6 changes: 6 additions & 0 deletions modules/vshn-lbaas-cloudscale/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ variable "internal_vip" {
default = ""
}

variable "internal_router_vip" {
type = string
description = "Virtual IP for the ingress controller/application router in the internal network"
default = ""
}

variable "team" {
type = string
description = "Team to assign the load balancers to in Icinga. All lower case."
Expand Down
25 changes: 13 additions & 12 deletions modules/vshn-lbaas-hieradata/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,19 @@ resource "local_file" "lb_hieradata" {
content = templatefile(
"${path.module}/templates/hieradata.yaml.tmpl",
{
"cloud_provider" = var.cloud_provider
"cluster_id" = var.cluster_id
"distribution" = var.distribution
"ingress_controller" = var.ingress_controller
"api_credentials" = local.api_credentials
"api_vip" = var.api_vip
"internal_vip" = var.internal_vip
"nat_vip" = var.nat_vip
"router_vip" = var.router_vip
"public_interface" = local.public_interface
"private_interfaces" = local.private_interfaces
"nodes" = local.instance_fqdns
"cloud_provider" = var.cloud_provider
"cluster_id" = var.cluster_id
"distribution" = var.distribution
"ingress_controller" = var.ingress_controller
"api_credentials" = local.api_credentials
"api_vip" = var.api_vip
"internal_vip" = var.internal_vip
"internal_router_vip" = var.internal_router_vip
"nat_vip" = var.nat_vip
"router_vip" = var.router_vip
"public_interface" = local.public_interface
"private_interfaces" = local.private_interfaces
"nodes" = local.instance_fqdns
"backends" = {
"api" = var.api_backends[*]
"router" = var.router_backends[*],
Expand Down
3 changes: 3 additions & 0 deletions modules/vshn-lbaas-hieradata/templates/hieradata.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ profile_openshift4_gateway::floating_address_provider: ${cloud_provider}
%{ if internal_vip != "" ~}
profile_openshift4_gateway::internal_vip: ${internal_vip}
%{ endif ~}
%{ if internal_router_vip != "" ~}
profile_openshift4_gateway::internal_router_vip: ${internal_router_vip}
%{ endif ~}
profile_openshift4_gateway::floating_address_settings:
%{ for k, v in api_credentials ~}
${k}: ${v}
Expand Down
6 changes: 6 additions & 0 deletions modules/vshn-lbaas-hieradata/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ variable "internal_vip" {
default = ""
}

variable "internal_router_vip" {
type = string
description = "Virtual IP for the ingress controller/application router in the internal network"
default = ""
}

variable "api_vip" {
type = string
description = "Floating IP for the Kubernetes/OpenShift API"
Expand Down

0 comments on commit 157dde2

Please sign in to comment.