如何在Prometheus-operator中启用持久性 [英] How to enable persistence in helm prometheus-operator

查看:116
本文介绍了如何在Prometheus-operator中启用持久性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用prometheus-operator掌舵图.我希望持久化Prometheus服务器中的数据.但是prometheus StatefulSet的打开重启,数据消失了.检查关联的StatefulSetPod对象的yaml定义时,没有PersistVolumeClaim.

I am using the prometheus-operator helm chart. I want the data in prometheus server to persist. But open restart of the prometheus StatefulSet, the data disappears. When inspecting the yaml definitions of the associated StatefulSet and Pod objects, there is no PersistVolumeClaim.

根据 https中的文档,我尝试了对values.yaml的以下更改: //github.com/helm/charts/tree/master/stable/prometheus :

I tried the following change to values.yaml, per the docs in https://github.com/helm/charts/tree/master/stable/prometheus:

prometheus:
  server:
    persistentVolume:
      enabled: true

但这对最终结果没有影响(即使在重新安装图表并重新安装StatefulSet之后).

but this has no effect on the end result (even after reinstalling the chart and reinstalling the StatefulSet).

我希望支持Prometheus服务器的StatefulSet具有持久的卷声明,以便在重新启动后持久保存数据.

I expect the StatefulSet backing the prometheus server to have persistent volume claims, so that data is persisted upon restart.

推荐答案

通过向values.yaml添加prometheus.prometheusSpec.storageSpec,将PersistentVolumeClaim成功附加到Prometheus服务器:

By adding a prometheus.prometheusSpec.storageSpec to values.yaml, the PersistentVolumeClaim was successfully attached to the Prometheus server:

prometheus:
  server:
    persistentVolume:
      enabled: true
  prometheusSpec:
    storageSpec:
      volumeClaimTemplate:
        spec:
          accessModes: ["ReadWriteOnce"]
          resources:
            requests:
              storage: 10Gi

这篇关于如何在Prometheus-operator中启用持久性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆