-
Notifications
You must be signed in to change notification settings - Fork 135
/
prometheus.tf
49 lines (46 loc) · 1.04 KB
/
prometheus.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#
# Prometheus
#
resource "google_compute_disk" "prometheus" {
name = "${var.indexer}-prometheus"
type = "pd-standard"
size = var.prometheus_disk_size
}
resource "kubernetes_persistent_volume" "prometheus" {
metadata {
name = "prometheus"
}
spec {
capacity = {
storage = "${var.prometheus_disk_size}Gi"
}
access_modes = ["ReadWriteOnce"]
persistent_volume_source {
gce_persistent_disk {
pd_name = google_compute_disk.prometheus.name
fs_type = "ext4"
}
}
storage_class_name = "standard"
}
}
resource "kubernetes_persistent_volume_claim" "prometheus" {
metadata {
name = "prometheus"
}
spec {
access_modes = ["ReadWriteOnce"]
resources {
requests = {
storage = "${var.prometheus_disk_size}Gi"
}
}
selector {
match_labels = {
"name" = kubernetes_persistent_volume.prometheus.metadata.0.name
}
}
storage_class_name = "standard"
volume_name = kubernetes_persistent_volume.prometheus.metadata.0.name
}
}