Skip to content

Commit 3779f44

Browse files
EZ4BRUCExzxiong
authored andcommitted
feat(): promtail support scrape node's /var/log (#178)
## What type of PR is this? * [ ] Feature * [ ] BUG * [ ] Alerts * [x] Improvement * [ ] Documentation * [ ] Test and CI ## Which issue(s) this PR related: issue # matrixorigin/MO-Cloud#1840 ## What this PR does / why we need it: 添加对 promtail 采集 node 日志的文件如下(白名单): - messages - boot.log - btmp - cron - maillog - secure
1 parent cd60a07 commit 3779f44

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

charts/mo-ob-opensource/values.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ promtail:
77
enabled: true
88
tolerations:
99
- operator: Exists
10+
extraArgs:
11+
- -config.expand-env=true
1012
config:
1113
logLevel: info
1214
logFormat: logfmt
@@ -24,6 +26,57 @@ promtail:
2426
# keep all kubernetes pod's labels
2527
- action: labelmap
2628
regex: __meta_kubernetes_pod_label_(.+)
29+
extraScrapeConfigs: |
30+
- job_name: host_log
31+
static_configs:
32+
- targets:
33+
- localhost
34+
labels:
35+
job: host_messages
36+
__path__: /var/log/host/messages
37+
node_name: '${HOSTNAME}'
38+
- targets:
39+
- localhost
40+
labels:
41+
job: host_boot_log
42+
__path__: /var/log/host/boot.log
43+
node_name: '${HOSTNAME}'
44+
- targets:
45+
- localhost
46+
labels:
47+
job: host_btmp
48+
__path__: /var/log/host/btmp
49+
node_name: '${HOSTNAME}'
50+
- targets:
51+
- localhost
52+
labels:
53+
job: host_cron
54+
__path__: /var/log/host/cron
55+
node_name: '${HOSTNAME}'
56+
- targets:
57+
- localhost
58+
labels:
59+
job: host_maillog
60+
__path__: /var/log/host/maillog
61+
node_name: '${HOSTNAME}'
62+
- targets:
63+
- localhost
64+
labels:
65+
job: host_secure
66+
__path__: /var/log/host/secure
67+
node_name: '${HOSTNAME}'
68+
# Extra volumes to be added in addition to those specified under `defaultVolumes`.
69+
extraVolumes:
70+
- name: local
71+
hostPath:
72+
# path: /var/log/messages
73+
path: /var/log
74+
75+
# Extra volume mounts together. Corresponds to `extraVolumes`.
76+
extraVolumeMounts:
77+
- name: local
78+
mountPath: /var/log/host
79+
readOnly: true
2780

2881
loki:
2982
enabled: true

0 commit comments

Comments
 (0)