Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.

Commit cfa36ef

Browse files
p-bizouardclaudusd
authored andcommitted
πŸ—οΈ Add Prometheus persistent storage configuration
1 parent 950822f commit cfa36ef

9 files changed

+66
-30
lines changed

β€Žcommon/prom-grafana-values.ymlβ€Ž

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,14 @@ grafana:
6666
default_home_dashboard_path: /var/lib/grafana/dashboards/k8s/k8s-views-global.json
6767
prometheus:
6868
prometheusSpec:
69+
%{ if prometheus_persistence_enabled }
70+
storageSpec:
71+
volumeClaimTemplate:
72+
spec:
73+
accessModes: ["ReadWriteOnce"]
74+
resources:
75+
requests:
76+
storage: ${prometheus_persistence_size}
77+
%{ endif }
6978
podMonitorSelectorNilUsesHelmValues: false
7079
serviceMonitorSelectorNilUsesHelmValues: false

β€Žcommon/prometheus-grafana.tfβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ resource "helm_release" "kube-prometheus" {
1212
grafana_admin_password = var.grafana_admin_password
1313
grafana_persistence_enabled = var.grafana_persistence_enabled
1414
grafana_persistence_size = var.grafana_persistence_size
15+
prometheus_persistence_enabled = var.prometheus_persistence_enabled
16+
prometheus_persistence_size = var.prometheus_persistence_size
1517
})]
1618
}

β€Žcommon/variables.tfβ€Ž

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,18 @@ variable "grafana_persistence_size" {
8787
default = "10Gi"
8888
}
8989

90+
variable "prometheus_persistence_enabled" {
91+
type = bool
92+
description = "Enable Prometheus persistence"
93+
default = false
94+
}
95+
96+
variable "prometheus_persistence_size" {
97+
type = string
98+
description = "Prometheus persistence size"
99+
default = "20Gi"
100+
}
101+
90102
variable "vault_server_hostname" {
91103
type = string
92104
description = "The hostname to use for the Vault server ingress"

β€Žovh/terraform.tfvars.exampleβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ grafana_hostname = "grafana.kubic.example"
3939
grafana_admin_password = "change_me"
4040
grafana_persistence_enabled = true
4141
grafana_persistence_size = "10Gi"
42+
prometheus_persistence_enabled = true
43+
prometheus_persistence_size = "20Gi"
4244
vault_server_hostname = "vault.kubic.example"
4345
install_hashicorp_vault = true
4446
vault_ui = true

β€Žovh/terraform.tfvars.templateβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ grafana_hostname=""
3333
grafana_admin_password=""
3434
grafana_persistence_enabled =
3535
grafana_persistence_size = ""
36+
prometheus_persistence_enabled =
37+
prometheus_persistence_size = ""
3638
vault_server_hostname=""
3739
install_hashicorp_vault=true
3840
vault_ui=true

β€Žscaleway/terraform.tfvars.exampleβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ grafana_hostname = "grafana.kubic.example"
3636
grafana_admin_password = "change_me"
3737
grafana_persistence_enabled = true
3838
grafana_persistence_size = "10Gi"
39+
prometheus_persistence_enabled = true
40+
prometheus_persistence_size = "20Gi"
3941
vault_server_hostname = "vault.kubic.example"
4042
install_hashicorp_vault = true
4143
vault_ui = true

β€Žscaleway/terraform.tfvars.templateβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ grafana_hostname = ""
3030
grafana_admin_password = ""
3131
grafana_persistence_enabled =
3232
grafana_persistence_size = ""
33+
prometheus_persistence_enabled =
34+
prometheus_persistence_size = ""
3335
vault_server_hostname = ""
3436
install_hashicorp_vault =
3537
vault_ui =

β€Žstandalone/terraform.tfvars.exampleβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ grafana_hostname = "grafana.kubic.example"
2727
grafana_admin_password = "change_me"
2828
grafana_persistence_enabled = true
2929
grafana_persistence_size = "10Gi"
30+
prometheus_persistence_enabled = true
31+
prometheus_persistence_size = "20Gi"
3032
vault_server_hostname = "vault.kubic.example"
3133
install_hashicorp_vault = true
3234
vault_ui = true

β€Žstate_bucket/.terraform.lock.hclβ€Ž

Lines changed: 33 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
Β (0)