【问题标题】:Using prometheus with volume to store data使用带volume的prometheus存储数据
【发布时间】:2021-03-25 22:44:03
【问题描述】:

我们使用 prometheus-operator 几个月了,效果很好。 现在我们需要添加持久化卷以将数据保存 3 个月,我们使用以下内容。

https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack

我添加了以下内容:(我们有 gp2 存储类)

storageSpec:
  volumeClaimTemplate:
    spec:
      storageClassName: gp2
      accessModes: ["ReadWriteOnce"]
      resources:
        requests:
          storage: 50Gi

https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml#L1969

我得到了错误:

persistentvolumeclaim "prometheus-po-kube-prometheus-stack-prometheus-db-prometheus-po-kube-prometheus-stack-prometheus-0" not found,

除了 values.yaml 之外,我还应该添加一些东西吗?

【问题讨论】:

    标签: amazon-web-services azure kubernetes prometheus prometheus-operator


    【解决方案1】:

    您缺少组件参考,您必须指定为哪个组件定义存储 - prometheus.prometheusSpec

    试试这个:

    prometheus:
      prometheusSpec:
        storageSpec:
          volumeClaimTemplate:
            spec:
              accessModes: [ "ReadWriteOnce" ]
              resources:
                requests:
                  storage: 50Gi
              storageClassName: gp2
    

    您可以在values.yaml找到更多信息

    【讨论】:

    猜你喜欢
    • 2019-12-21
    • 2019-02-28
    • 2020-09-17
    • 1970-01-01
    • 2020-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多