Skip to content

Commit

Permalink
Update DNS zone output to emit ingress-int record if internal route…
Browse files Browse the repository at this point in the history
…r VIP is set
  • Loading branch information
simu committed Jul 17, 2024
1 parent 69fd4f6 commit 2648402
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
19 changes: 10 additions & 9 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
output "dns_entries" {
value = templatefile("${path.module}/templates/dns.zone", {
"node_name_suffix" = local.node_name_suffix,
"api_vip" = var.enable_api_vip && var.lb_count != 0 ? split("/", module.lb.api_vip[0].network)[0] : ""
"router_vip" = var.enable_router_vip && var.lb_count != 0 ? split("/", module.lb.router_vip[0].network)[0] : ""
"egress_vip" = var.enable_nat_vip && var.lb_count != 0 ? split("/", module.lb.nat_vip[0].network)[0] : ""
"internal_vip" = cidrhost(local.privnet_cidr, 100),
"masters" = module.master.ip_addresses,
"cluster_id" = var.cluster_id,
"lbs" = module.lb.public_ipv4_addresses,
"lb_hostnames" = module.lb.server_names
"node_name_suffix" = local.node_name_suffix,
"api_vip" = var.enable_api_vip && var.lb_count != 0 ? split("/", module.lb.api_vip[0].network)[0] : ""
"router_vip" = var.enable_router_vip && var.lb_count != 0 ? split("/", module.lb.router_vip[0].network)[0] : ""
"egress_vip" = var.enable_nat_vip && var.lb_count != 0 ? split("/", module.lb.nat_vip[0].network)[0] : ""
"internal_vip" = local.internal_vip,
"internal_router_vip" = var.internal_router_vip,
"masters" = module.master.ip_addresses,
"cluster_id" = var.cluster_id,
"lbs" = module.lb.public_ipv4_addresses,
"lb_hostnames" = module.lb.server_names
})
}

Expand Down
3 changes: 3 additions & 0 deletions templates/dns.zone
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ api-int IN A ${internal_vip}
%{ if router_vip != "" ~}
ingress IN A ${router_vip}
%{ endif ~}
%{ if internal_router_vip != "" ~}
ingress-int IN A ${internal_router_vip}
%{ endif ~}
%{ if egress_vip != "" ~}
egress IN A ${egress_vip}
%{ endif ~}
Expand Down

0 comments on commit 2648402

Please sign in to comment.