Skip to content

Commit

Permalink
Split endpoint information into parts.
Browse files Browse the repository at this point in the history
  • Loading branch information
zawac002 committed Sep 15, 2023
1 parent 7bcfb0f commit ab52703
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 32 deletions.
8 changes: 8 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -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

Expand Down
34 changes: 2 additions & 32 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit ab52703

Please sign in to comment.