I have deployed the Prometheus operator with Kube-state-metric
. I wanted to store the metrics for just 30 minutes period of time since the data is stored in the in-memory storage. I don't have any PVC attached to the pod. I have set a retention period for the '30s'. But Prometheus is not deleting the old metrics after 30 minutes.
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
labels:
prometheus: k8s
name: k8s
namespace: monitoring
spec:
beta.kubernetes.io/os: linux
replicas: 3
resources:
limits:
memory: 300Mi
cpu: 300m
requests:
memory: 200Mi
cpu: 200m
ruleSelector:
matchLabels:
prometheus: k8s
role: alert-rules
securityContext:
fsGroup: 2000
runAsNonRoot: true
runAsUser: 1000
serviceAccountName: prometheus-k8s
logLevel: info
retention: 30m
storage:
emptyDir: {}
version: v2.5.0