Skip to content

Commit

Permalink
Merge pull request #4 from junior/main
Browse files Browse the repository at this point in the history
grafana quick fix
  • Loading branch information
junior authored Sep 9, 2022
2 parents c903e97 + 8e0c6a3 commit cb730c0
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
6 changes: 6 additions & 0 deletions module-cluster-tools.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,9 @@ variable "grafana_enabled" {
default = false
description = "Enable Grafana Dashboards. Includes example dashboards and Prometheus, OCI Logging and OCI Metrics datasources"
}

# Cluster Tools Outputs
output "grafana_admin_password" {
value = module.cluster-tools.grafana_admin_password
sensitive = true
}
22 changes: 21 additions & 1 deletion modules/cluster-tools/grafana.tf
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,24 @@ EOF
]

count = var.grafana_enabled ? 1 : 0
}
}

## Kubernetes Secret: Grafana Admin Password
data "kubernetes_secret" "grafana" {
metadata {
name = "grafana"
namespace = kubernetes_namespace.cluster_tools.id
}
depends_on = [helm_release.grafana]

count = var.grafana_enabled ? 1 : 0
}

locals {
grafana_admin_password = var.grafana_enabled ? data.kubernetes_secret.grafana.0.data.admin-password : "Grafana_Not_Deployed"
}

output "grafana_admin_password" {
value = var.grafana_enabled ? local.grafana_admin_password : null
sensitive = true
}
13 changes: 12 additions & 1 deletion modules/cluster-tools/ingress-nginx.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,15 @@ resource "helm_release" "ingress_nginx" {
}

count = var.ingress_nginx_enabled ? 1 : 0
}
}

## Kubernetes Service: ingress-nginx-controller
data "kubernetes_service" "ingress" {
metadata {
name = "ingress-nginx-controller"
namespace = kubernetes_namespace.cluster_tools.id
}
depends_on = [helm_release.ingress_nginx]

count = var.ingress_nginx_enabled ? 1 : 0
}

0 comments on commit cb730c0

Please sign in to comment.