From ab52703a9677487fe42a5ff30259b5a0bff5c7de Mon Sep 17 00:00:00 2001 From: Anthony Zawacki Date: Fri, 15 Sep 2023 09:58:14 -0400 Subject: [PATCH] Split endpoint information into parts. --- main.tf | 8 ++++++++ outputs.tf | 34 ++-------------------------------- 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/main.tf b/main.tf index c35aa4e..8beaf15 100644 --- a/main.tf +++ b/main.tf @@ -1,3 +1,11 @@ +locals { + gateway_internal = { + hostname = format("loki-gateway.%v.svc.cluster.local", local.ns) + port_number = "80" + url = format("http://loki-gateway.%v.svc.cluster.local", local.ns) + } +} + resource "kubernetes_namespace" "ns" { count = var.create_namespace == "true" ? 1 : 0 diff --git a/outputs.tf b/outputs.tf index 5e2246c..8ccef03 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,36 +1,6 @@ -output "internal_url" { - description = "The endpoint which can be used inside of the cluster to access loki-backend." - value = format("http://loki-backend.%v.svc.cluster.local", local.ns) -} - -output "headless_internal_url" { - description = "The endpoint which can be used inside of the cluster to access headless-loki-backend." - value = format("http://loki-backend-headless.%v.svc.cluster.local", local.ns) -} - -output "gateway_internal_url" { +output "gateway_internal_endpoint" { description = "The endpoint which can be used inside of the cluster to access loki-gateway." - value = format("http://loki-backend-headless.%v.svc.cluster.local", local.ns) -} - -output "read_headless_internal_url" { - description = "The endpoint which can be used inside of the cluster to access loki-read-headless." - value = format("http://loki-read-headless.%v.svc.cluster.local", local.ns) -} - -output "read_internal_url" { - description = "The endpoint which can be used inside of the cluster to access loki-read." - value = format("http://loki-read.%v.svc.cluster.local", local.ns) -} - -output "write_headless_internal_url" { - description = "The endpoint which can be used inside of the cluster to access loki-write-headless." - value = format("http://loki-write-headless.%v.svc.cluster.local", local.ns) -} - -output "write_internal_url" { - description = "The endpoint which can be used inside of the cluster to access loki-write." - value = format("http://loki-write.%v.svc.cluster.local", local.ns) + value = local.gateway_internal }