forked from grafana/jsonnet-libs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
promtail-configmap.yaml
34 lines (30 loc) · 945 Bytes
/
promtail-configmap.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
apiVersion: v1
kind: ConfigMap
metadata:
name: promtail-config
namespace: default
data:
promtail.yml: |
scrape_config:
- job_name: 'kubernetes-pods'
kubernetes_sd_configs:
- role: pod
relabel_configs:
# Drop pods without a name label
- source_labels: [__meta_kubernetes_pod_label_name]
action: drop
regex: ^$
# Rename jobs to be <namespace>/<name>, from pod name label
- source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_pod_label_name]
action: replace
separator: /
target_label: job
replacement: $1
# Rename instances to be the pod name
- source_labels: [__meta_kubernetes_pod_name]
action: replace
target_label: instance
- source_labels: [__meta_kubernetes_pod_uid]
target_label: "__path__"
replacement: "/var/log/pods/$1/"