Prometheus 忽略设置 storage.tsdb.retention。*

问题描述 投票:0回答:1

我有以下部署设置:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: prometheus-deployment
  namespace: monitoring
  labels:
    app: prometheus-server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: prometheus-server
  template:
    metadata:
      labels:
        app: prometheus-server
    spec:
      containers:
        - name: prometheus
          image: prom/prometheus
          args:
            - "--storage.tsdb.retention.time=2h"
            - "--storage.tsdb.retention.size=1KB"
            #- "--storage.tsdb.wal-compression"
            - "--config.file=/etc/prometheus/prometheus.yml"
            - "--storage.tsdb.path=/prometheus/"
          ports:
            - containerPort: 9090
          resources:
            requests:
              cpu: 500m
              memory: 500M
            limits:
              cpu: 1
              memory: 1Gi
          volumeMounts:
            - name: prometheus-config-volume
              mountPath: /etc/prometheus/
            - name: prometheus-storage-volume
              mountPath: /prometheus/
      volumes:
        - name: prometheus-config-volume
          configMap:
            defaultMode: 420
            name: prometheus-server-conf
  
        - name: prometheus-storage-volume
          emptyDir: {}

我将信息限制为两种设置:

  1. --storage.tsdb.retention.time=2h - 2小时后删除旧信息
  2. --storage.tsdb.retention.size=1KB - 限制存储信息量(用于测试。我尝试了其他值:1MB、1GB 等)

the settings applied

然而,Prometheus 忽略了我的设置,尽管最小大小为 1KB,但数据仍继续显示。

忽略设置的最小尺寸...

这个问题是什么原因以及如何解决?

kubernetes devops prometheus
1个回答
0
投票

我也遇到了同样的问题。使用 prometheus kps 图表在 helm 安装的 k8 上运行。

© www.soinside.com 2019 - 2024. All rights reserved.