Permalink
Browse files

Add persistent storage to Prometheus

Previously, our Prometheus cluster did not have any persistent storage.
Follow https://github.com/coreos/prometheus-operator/blob/master/Documentation/user-guides/storage.md
to configure persistent storage via a StorageClass. Configuring ~40GB
will cost us ~$4 a month.

Note, long term it may make sense for the `prometheus-ssd` StorageClass
to just become the `ssd` StorageClass and become generic across the
cluster.

One small downside, is that manifests relating to Storage may not work
with Minikube. Long term, I'll address this discrepancy via Helm
templates, but for now, I'll need to just remember it and comment out
the offending lines when using Minikube.
  • Loading branch information...
mattjmcnaughton committed Nov 4, 2018
1 parent 3a9c395 commit ca34bddc14122294195b9e4008e9aecc1f4a9a44
@@ -11,6 +11,9 @@ spec:
# the Prometheus Operator creates a stateful set. So we will have `#replicas`
# pods in our stateful set.
replicas: 2
# Retain data for 90 days. Note, we may need to decrease these if we find it
# requires too much storage.
retention: "90d"
serviceAccountName: prometheus
# ServiceMonitors specify how the Prometheus cluster should scrape metrics. We
# attach `ServiceMonitors` we've defined to this Prometheus cluster using the
@@ -21,3 +24,12 @@ spec:
resources:
requests:
memory: 400Mi
# @TODO(mattjmcnaughton) Determine a way to make this work when using
# Minikube. I may need to wait until I'm templating this via a Helm chart.
storage:
volumeClaimTemplate:
spec:
storageClassName: prometheus-ssd
resources:
requests:
storage: 20Gi
@@ -0,0 +1,11 @@
---
# This manifest declares the StorageClass from which our Prometheus instance
# claims persistent storage. Note, we may eventually want to have a generic
# claim for using ssds that we can use across our entire cluster.
apiVersion: storage.k8s.io/v1beta1
kind: StorageClass
metadata:
name: prometheus-ssd
provisioner: kubernetes.io/aws-ebs
parameters:
type: gp2

0 comments on commit ca34bdd

Please sign in to comment.