Marc Bachmann
|
4b13e30227
|
Fix prometheus queries
Example prometheus-operator deployment with kube-prometheus-stack:
```
kubectl create ns monitoring
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install -n monitoring prometheus prometheus-community/kube-prometheus-stack
```
Patch the node-exporter to include a `node` label:
```
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: prometheus-kube-prometheus-node-exporter
namespace: monitoring
spec:
endpoints:
- port: metrics
+ relabelings:
+ - regex: (.+)
+ sourceLabels:
+ - __meta_kubernetes_endpoint_node_name
+ targetLabel: node
jobLabel: jobLabel
namespaceSelector:
matchNames:
- prometheus-operator-test
selector:
matchLabels:
app: prometheus-node-exporter
release: prometheus
````
Signed-off-by: Marc Bachmann <marc.brookman@gmail.com>
|
2021-10-05 02:50:53 +02:00 |
|