Skip to content

Commit

Permalink
fix: use /grafana path for monitoring endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Styren committed Apr 21, 2023
1 parent 5525fe5 commit 068c909
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
5 changes: 5 additions & 0 deletions infrastructure/modules/container-registry/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
include "root" {
path = find_in_parent_folders("root.hcl")
}

dependency "nginx_ingress" {
config_path = "../nginx-ingress"
skip_outputs = true
}
4 changes: 3 additions & 1 deletion infrastructure/modules/monitoring/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ resource "helm_release" "prometheus_stack" {
values = [
templatefile("${path.module}/values.yaml", {
namespace = local.namespace,
grafana_host = "grafana.${data.kubernetes_config_map.domain.data.domain}",
host = data.kubernetes_config_map.domain.data.domain,
ingress_annotations = jsonencode(var.ingress_annotations),
})
]
Expand All @@ -52,6 +52,8 @@ resource "helm_release" "prometheus_stack" {
name = "grafana.adminPassword"
value = random_password.grafana.result
}

timeout = 600
}

resource "helm_release" "jaeger_operator" {
Expand Down
5 changes: 5 additions & 0 deletions infrastructure/modules/monitoring/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ dependency "cert_manager" {
config_path = "../cert-manager"
skip_outputs = true
}

dependency "nginx_ingress" {
config_path = "../nginx-ingress"
skip_outputs = true
}
12 changes: 7 additions & 5 deletions infrastructure/modules/monitoring/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ grafana:

grafana.ini:
server:
domain: ${grafana_host}
root_url: "%(protocol)s://%(domain)s/"
domain: ${host}
root_url: "%(protocol)s://%(domain)s/grafana/"
serve_from_sub_path: true
alerting:
enabled: false
unified_alerting:
Expand All @@ -47,15 +48,16 @@ grafana:
ingress:
enabled: true
annotations:
"acme.cert-manager.io/http01-edit-in-place": "true"
"kubernetes.io/ingress.class": "nginx"
"kubernetes.io/tls-acme": "true"
"cert-manager.io/cluster-issuer": "letsencrypt"
hosts: ["${grafana_host}"]
"nginx.ingress.kubernetes.io/rewrite-target": "/$2"
hosts: ["${host}"]
pathType: Prefix
path: /grafana(/|$)(.*)
tls:
- secretName: grafana-general-tls
hosts: ["${grafana_host}"]
hosts: ["${host}"]

prometheus:
enabled: true
Expand Down

0 comments on commit 068c909

Please sign in to comment.