Search code examples
kubernetespersistencekubernetes-helm

How to enable persistence in prometheus-community chart?


I am trying to set up persistent storage with the new prometheus-community helm chart. I have modified the helm values files as seen below. Currently when the chart is reinstalled (I use Tiltfiles for this) the PVC is deleted and therefore the data is not persisted. I assume that the problem could have something to do with the fact that there is no statefulset running for the server, but I am not sure how to fix it.

(The solutions from here does not solve my problem, as it is for the old chart.)

server:
  persistentVolume:
    enabled: true
    storageClass: default
    accessModes:
    - ReadWriteOnce
    size: 8Gi 

Solution

  • I enabled the statefulset on the prometheus server and now it seems to work.

    server:
      persistentVolume:
        enabled: true
        storageClass: default-hdd-retain
        accessModes:
        - ReadWriteOnce
        size: 40Gi
      statefulSet:
        enabled: true