Skip to content

Commit 6f110c0

Browse files
committed
🔧(k8s) configure grafana to enable its ingress
In the helm chart managing the prometheus stack, it is possible to enable the grafana ingress in order to access its admin and visualize all the metrics. Some variables are added to configure this part.
1 parent ccecd16 commit 6f110c0

File tree

6 files changed

+58
-7
lines changed

6 files changed

+58
-7
lines changed

k8s/base/jibri-hpa.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# metric, which takes into account all jibri pods in the namespace (those
2121
# managed by the deployment + the orphaned pods that are busy)
2222

23-
apiVersion: autoscaling/v2beta2
23+
apiVersion: autoscaling/v2
2424
kind: HorizontalPodAutoscaler
2525
metadata:
2626
name: jibri-hpa

k8s/base/jitsi-meet-front-hpa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: autoscaling/v2beta2
1+
apiVersion: autoscaling/v2
22
kind: HorizontalPodAutoscaler
33
metadata:
44
name: jitsi-meet-front-hpa

k8s/base/jvb-deployment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ spec:
9393
# Sidecar container that exports stats for Prometheus
9494
# Values are scraped by ./jvb-podmonitor.yml
9595
- name: exporter
96-
image: systemli/prometheus-jitsi-meet-exporter:1.2.0
96+
image: systemli/prometheus-jitsi-meet-exporter:1.2.1
9797
imagePullPolicy: IfNotPresent
9898
livenessProbe:
9999
failureThreshold: 5

k8s/base/jvb-hpa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: autoscaling/v2beta2
1+
apiVersion: autoscaling/v2
22
kind: HorizontalPodAutoscaler
33
metadata:
44
name: jvb-hpa

terraform/prometheus.tf

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ resource "helm_release" "kube-prometheus-stack" {
2929
}
3030

3131
# Add Jitsi-Meet dashboards to Grafana
32-
# Dashboards are fetched from https://github.com/systemli/prometheus-jitsi-meet-exporter/tree/1.2.0/dashboards
32+
# Dashboards are fetched from https://github.com/systemli/prometheus-jitsi-meet-exporter/tree/1.2.1/dashboards
3333
# Values are merged with https://github.com/grafana/helm-charts/blob/main/charts/grafana/values.yaml
3434
set {
3535
name = "grafana.dashboardProviders.dashboardproviders\\.yaml.apiVersion"
@@ -53,7 +53,7 @@ resource "helm_release" "kube-prometheus-stack" {
5353

5454
set {
5555
name = "grafana.dashboards.jitsi.jitsi-meet.url"
56-
value = "https://raw.githubusercontent.com/systemli/prometheus-jitsi-meet-exporter/1.2.0/dashboards/jitsi-meet.json"
56+
value = "https://raw.githubusercontent.com/systemli/prometheus-jitsi-meet-exporter/1.2.1/dashboards/jitsi-meet.json"
5757
}
5858

5959
set {
@@ -63,7 +63,32 @@ resource "helm_release" "kube-prometheus-stack" {
6363

6464
set {
6565
name = "grafana.dashboards.jitsi.jitsi-meet-system.url"
66-
value = "https://raw.githubusercontent.com/systemli/prometheus-jitsi-meet-exporter/1.2.0/dashboards/jitsi-meet-system.json"
66+
value = "https://raw.githubusercontent.com/systemli/prometheus-jitsi-meet-exporter/1.2.1/dashboards/jitsi-meet-system.json"
67+
}
68+
69+
set {
70+
name = "grafana.ingress.enabled"
71+
value = lookup(var.k8s_grafana_ingress_enabled, terraform.workspace, false)
72+
}
73+
74+
set {
75+
name = "grafana.ingress.ingressClassName"
76+
value = "nginx"
77+
}
78+
79+
set {
80+
name = "grafana.ingress.hosts[0]"
81+
value = lookup(var.k8s_grafana_ingress_host, terraform.workspace, "monitoring.example.com")
82+
}
83+
84+
set {
85+
name = "grafana.ingress.annotations.cert-manager\\.io/issuer"
86+
value = "letsencrypt-jitsi-issuer"
87+
}
88+
89+
set_sensitive {
90+
name = "grafana.adminPassword"
91+
value = lookup(var.k8s_grafana_admin_passord, terraform.workspace, "ThisIsNotASecurePassword")
6792
}
6893

6994
set {

terraform/variables.tf

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,4 +280,30 @@ variable "k8s_ingress_nginx_version" {
280280
default = {
281281
preprod = "3.39.0"
282282
}
283+
}
284+
285+
variable "k8s_grafana_ingress_enabled" {
286+
type = map(bool)
287+
description = "enable ingress for grafana UI"
288+
289+
default = {
290+
}
291+
}
292+
293+
variable "k8s_grafana_ingress_host" {
294+
type = map(string)
295+
description = "host to reach grafana admin"
296+
297+
default = {
298+
preprod="grafana.preprod.exemple.com"
299+
}
300+
}
301+
302+
variable "k8s_grafana_admin_passord" {
303+
type = map(string)
304+
description = "grafana admin password"
305+
306+
default = {
307+
preprod="this is an invalid password"
308+
}
283309
}

0 commit comments

Comments
 (0)