Skip to content

Commit

Permalink
26 add grafana chart to monitoring stack (#27)
Browse files Browse the repository at this point in the history
* add grafana helm chart

* add grafana helm chart
  • Loading branch information
federeynimbux authored Dec 2, 2022
1 parent 2142a25 commit 1134a87
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [4.3.0] - 2022-12-02

### Added
- grafana helm chart

## [4.2.1] - 2022-11-16

### Fixed
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Terraform module which creates EKS Cluster and dependent resources on AWS.
- [Loki Distributed Helm Chart](https://github.com/grafana/helm-charts/tree/main/charts/loki-distributed)
- [Fluent Bit Helm Chart](https://github.com/fluent/helm-charts/tree/main/charts/fluent-bit)
- [Tempo Distributed Helm Chart](https://github.com/grafana/helm-charts/tree/main/charts/tempo-distributed)
- [Grafana Helm Chart](https://github.com/grafana/helm-charts/tree/main/charts/grafana)


## Usage
Expand Down Expand Up @@ -173,6 +174,12 @@ module "eks_main" {
# open-telemetry
k8s_opentelemetry_enabled = true
# =================== grafana ================== #
helm_grafana_enabled = true
grafana_ingress_enabled = true
grafana_ingress_host = "grafana.example.com"
}
```
Expand Down Expand Up @@ -330,6 +337,12 @@ module "eks_main" {
| tempo\_gateway\_ingress\_path | Path for ingress rule | `string` | `/` | no |
| tempo\_ingress\_path\_type | Path type for ingress rule | `string` | `Prefix` | no |
| tempo\_ingress\_class\_name | ingress className | `string` | `nginx` | no |
| helm\_grafana\_enabled | install grafana helm chart | `bool` | `false` | no |
| grafana\_ingress\_enabled | Enable ingress for grafana | `bool` | `false` | no |
| grafana\_ingress\_host | Host for ingress rule | `string` | `""` | no |
| grafana\_ingress\_path | Path for ingress rule | `string` | `/` | no |
| grafana\_ingress\_path\_type | Path type for ingress rule | `string` | `Prefix` | no |
| grafana\_ingress\_class\_name | ingress className | `string` | `nginx` | no

## Outputs

Expand Down
44 changes: 39 additions & 5 deletions helm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,6 @@ resource "helm_release" "prometheus_stack" {
dependency_update = true
timeout = 600

set {
name = "grafana.enabled"
value = false
}

set {
name = "prometheus.prometheusSpec.replicas"
value = var.prometheus_replicas
Expand Down Expand Up @@ -1076,3 +1071,42 @@ resource "helm_release" "tempo_distributed" {
}

}

# ========================= grafana ========================= #

resource "helm_release" "grafana_stack" {
count = var.helm_grafana_enabled ? 1 : 0
name = "grafana"
namespace = "monitoring"
create_namespace = true
repository = "https://grafana.github.io/helm-charts"
chart = "grafana"
version = "6.45.0"
dependency_update = true
timeout = 600

set {
name = "ingress.enabled"
value = var.grafana_ingress_enabled
}

set {
name = "ingress.hosts[0]"
value = var.grafana_ingress_host
}

set {
name = "ingress.path"
value = var.grafana_ingress_path
}

set {
name = "ingress.pathType"
value = var.grafana_ingress_path_type
}

set {
name = "ingress.ingressClassName"
value = var.grafana_ingress_class_name
}
}
25 changes: 25 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -646,4 +646,29 @@ variable "tempo_ingress_class_name" {
# open-telemetry
variable "k8s_opentelemetry_enabled" {
default = false
}

# ============================== grafana ============================== #
variable "helm_grafana_enabled" {
default = false
}

variable "grafana_ingress_enabled" {
default = false
}

variable "grafana_ingress_host" {
default = ""
}

variable "grafana_ingress_path" {
default = "/"
}

variable "grafana_ingress_path_type" {
default = "Prefix"
}

variable "grafana_ingress_class_name" {
default = "nginx"
}

0 comments on commit 1134a87

Please sign in to comment.