Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vshn-lbaas-cloudscale: Add variable to configure an internal router VIP #56

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading