On my local KinD cluster, I deployed:
- Prometheus using
kube-prometheus-stack
, everything with default values. - Thanos using Bitnami’s chart, and the following values file:
query:
enabled: true
logLevel: debug
dnsDiscovery:
enabled: false
stores:
- thanos-ruler.prometheus.svc.cluster.local:10901
resources:
limits:
cpu: 100m
memory: 256Mi
requests:
cpu: 50m
memory: 128Mi
ruler:
enabled: true
logLevel: debug
clusterName: local-ruler
alertmanagers:
- http://prometheus-kube-prometheus-alertmanager.prometheus.svc.cluster.local:9093
config: |-
groups:
- name: example
rules:
- alert: HighCPUUsage
expr: 100 - (avg by(instance) (rate(node_cpu_seconds_total{mode="idle"}[2m])) * 100) > 80
for: 5m
labels:
severity: warning
annotations:
summary: High CPU usage detected
resources:
limits:
cpu: 100m
memory: 256Mi
requests:
cpu: 50m
memory: 128Mi
metrics:
enabled: true
serviceMonitor:
enabled: true
prometheusRule:
enabled: false
objstoreConfig: |-
type: FILESYSTEM
config:
directory: /tmp/thanos/object-storage
When I port-forward svc/thanos-query-frontend
and check “Rules”, I only see the static HighCPUUsage
rule I deployed along with the Thanos Ruler.
However, I also applied a another rule:
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: test-rule
namespace: prometheus
labels:
release: prometheus
spec:
groups:
- name: test.rules
rules:
- alert: Suka
expr: vector(1) == 1
for: 5s
labels:
severity: warning
annotations:
summary: "This is a test alert"
description: "This is a test alert"
I’d expect to see this rule under Thanos as well, but I only see it in the Prometheus instance. I’m not sure what I’m misunderstanding with my setup.