Skip to content

Commit 2ef2af9

Browse files
committed
Update Readme.md
1 parent e394763 commit 2ef2af9

File tree

4 files changed

+26
-15
lines changed

4 files changed

+26
-15
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,17 @@ spec:
9797
- name: log
9898
mountPath: /log
9999
readOnly: true
100+
- name: localtime
101+
mountPath: /etc/localtime
102+
readOnly: true
100103
volumes:
101104
- name: log
102105
# Config `log` to your system log directory
103106
hostPath:
104107
path: /var/log/
108+
- name: localtime
109+
hostPath:
110+
path: /etc/localtime
105111
```
106112
* Edit node-problem-detector.yaml to fit your environment: Set `log` volume to your system log diretory. (Used by KernelMonitor)
107113
* Create the DaemonSet with `kubectl create -f node-problem-detector.yaml`

config/kernel-monitor.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"plugin": "journald",
3-
"logPath": "/log/journal",
3+
"logPath": "/var/log/journal",
44
"lookback": "10m",
55
"startPattern": "Initializing cgroup subsys cpuset",
66
"bufferSize": 10,

node-problem-detector.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spec:
2525
fieldPath: spec.nodeName
2626
volumeMounts:
2727
- name: log
28-
mountPath: /log
28+
mountPath: /var/log
2929
readOnly: true
3030
# Make sure node problem detector is in the same timezone
3131
# with the host.

pkg/kernelmonitor/README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,8 @@ The rule list is extensible.
99

1010
## Limitations
1111

12-
* Kernel Monitor only supports file based kernel log now. It doesn't support log tools
13-
like journald. There is an [open issue](https://github.com/kubernetes/node-problem-detector/issues/14)
14-
to add journald support.
15-
16-
* Kernel Monitor has assumption on kernel log format, now it only works on Ubuntu and
17-
Debian. However, it is easy to extend it to [support other log format](#support-other-log-format).
12+
* Kernel Monitor only supports syslog (rsyslog) and journald now, but it is easy
13+
to extend it with [new log watcher](#new-log-watcher)
1814

1915
## Add New NodeConditions
2016

@@ -43,14 +39,23 @@ with new rule definition:
4339
}
4440
```
4541

46-
## Change Log Path
42+
## Log Watchers
43+
44+
Kernel monitor supports different log management tools with different log
45+
watchers:
46+
* [syslog](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/kernelmonitor/logwatchers/syslog)
47+
* [journald](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/kernelmonitor/logwatchers/journald)
48+
49+
### Change Log Path
4750

48-
Kernel log in different OS distros may locate in different path. The `log`
51+
Kernel log on different OS distros may locate in different path. The `logPath`
4952
field in `config/kernel-monitor.json` is the log path inside the container.
50-
You can always configure it to match your OS distro.
53+
You can always configure `logPath` and volume mount to match your OS distro.
54+
* syslog: `logPath` is the kernel log path, usually `/var/log/kern.log`.
55+
* journald: `logPath` is the journal log directory, usually `/var/log/journal`.
5156

52-
## Support Other Log Format
57+
### New Log Watcher
5358

54-
Kernel monitor uses [`Translator`](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/kernelmonitor/translator/translator.go)
55-
plugin to translate kernel log the internal data structure. It is easy to
56-
implement a new translator for a new log format.
59+
Kernel monitor uses [Log
60+
Watcher](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/kernelmonitor/logwatchers/types/log_watcher.go) to support different log management tools.
61+
It is easy to implement a new log watcher.

0 commit comments

Comments
 (0)