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 }