Update Readme.md

This commit is contained in:
Random-Liu
2016-11-19 18:40:59 -08:00
parent e39476300a
commit 2ef2af99eb
4 changed files with 26 additions and 15 deletions

View File

@@ -97,11 +97,17 @@ spec:
- name: log
mountPath: /log
readOnly: true
- name: localtime
mountPath: /etc/localtime
readOnly: true
volumes:
- name: log
# Config `log` to your system log directory
hostPath:
path: /var/log/
- name: localtime
hostPath:
path: /etc/localtime
```
* Edit node-problem-detector.yaml to fit your environment: Set `log` volume to your system log diretory. (Used by KernelMonitor)
* Create the DaemonSet with `kubectl create -f node-problem-detector.yaml`

View File

@@ -1,6 +1,6 @@
{
"plugin": "journald",
"logPath": "/log/journal",
"logPath": "/var/log/journal",
"lookback": "10m",
"startPattern": "Initializing cgroup subsys cpuset",
"bufferSize": 10,

View File

@@ -25,7 +25,7 @@ spec:
fieldPath: spec.nodeName
volumeMounts:
- name: log
mountPath: /log
mountPath: /var/log
readOnly: true
# Make sure node problem detector is in the same timezone
# with the host.

View File

@@ -9,12 +9,8 @@ The rule list is extensible.
## Limitations
* Kernel Monitor only supports file based kernel log now. It doesn't support log tools
like journald. There is an [open issue](https://github.com/kubernetes/node-problem-detector/issues/14)
to add journald support.
* Kernel Monitor has assumption on kernel log format, now it only works on Ubuntu and
Debian. However, it is easy to extend it to [support other log format](#support-other-log-format).
* Kernel Monitor only supports syslog (rsyslog) and journald now, but it is easy
to extend it with [new log watcher](#new-log-watcher)
## Add New NodeConditions
@@ -43,14 +39,23 @@ with new rule definition:
}
```
## Change Log Path
## Log Watchers
Kernel log in different OS distros may locate in different path. The `log`
Kernel monitor supports different log management tools with different log
watchers:
* [syslog](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/kernelmonitor/logwatchers/syslog)
* [journald](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/kernelmonitor/logwatchers/journald)
### Change Log Path
Kernel log on different OS distros may locate in different path. The `logPath`
field in `config/kernel-monitor.json` is the log path inside the container.
You can always configure it to match your OS distro.
You can always configure `logPath` and volume mount to match your OS distro.
* syslog: `logPath` is the kernel log path, usually `/var/log/kern.log`.
* journald: `logPath` is the journal log directory, usually `/var/log/journal`.
## Support Other Log Format
### New Log Watcher
Kernel monitor uses [`Translator`](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/kernelmonitor/translator/translator.go)
plugin to translate kernel log the internal data structure. It is easy to
implement a new translator for a new log format.
Kernel monitor uses [Log
Watcher](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/kernelmonitor/logwatchers/types/log_watcher.go) to support different log management tools.
It is easy to implement a new log watcher.