Skip to content

Commit

Permalink
kmsg: update the docs to reference kmsg parser too
Browse files Browse the repository at this point in the history
  • Loading branch information
euank committed Mar 10, 2017
1 parent 7364867 commit 8d1158d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 46 deletions.
42 changes: 5 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Refer [heapster docs](https://github.com/kubernetes/heapster/blob/master/docs/so
* `--hostname-override`: A customized node name used for node-problem-detector to update conditions and emit events. node-problem-detector gets node name first from `hostname-override`, then `NODE_NAME` environment variable and finally fall back to `os.Hostname`.

## Build Image

Run `make` in the top directory. It will:
* Build the binary.
* Build the docker image. The binary and `config/` are copied into the docker image.
Expand All @@ -78,48 +79,15 @@ Run `make` in the top directory. It will:
to another registry

## Start DaemonSet
* Create a file node-problem-detector.yaml with the following yaml.
```yaml
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: node-problem-detector
spec:
template:
spec:
containers:
- name: node-problem-detector
image: gcr.io/google_containers/node-problem-detector:v0.2
imagePullPolicy: Always
securityContext:
privileged: true
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- 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
```

* Define a daemonset similar to [node-problem-detector.yaml][node-problem-detector.yaml].
* Edit node-problem-detector.yaml to fit your environment: Set `log` volume to your system log diretory. (Used by SystemLogMonitor)
* Create the DaemonSet with `kubectl create -f node-problem-detector.yaml`
* If needed, you can use [ConfigMap](http://kubernetes.io/docs/user-guide/configmap/)
* If needed, you can use a [ConfigMap](http://kubernetes.io/docs/user-guide/configmap/)
to overwrite the `config/`.

## Start Standalone

To run node-problem-detector standalone, you should set `inClusterConfig` to `false` and
teach node-problem-detector how to access apiserver with `apiserver-override`.

Expand Down
6 changes: 6 additions & 0 deletions node-problem-detector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ spec:
- name: log
mountPath: /var/log
readOnly: true
- name: kmsg
mountPath: /dev/kmsg
readOnly: true
# Make sure node problem detector is in the same timezone
# with the host.
- name: localtime
Expand All @@ -40,6 +43,9 @@ spec:
# Config `log` to your system log directory
hostPath:
path: /var/log/
- name: kmsg
hostPath:
path: /dev/kmsg
- name: localtime
hostPath:
path: /etc/localtime
Expand Down
20 changes: 11 additions & 9 deletions pkg/systemlogmonitor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ the configuration files. (
[`config/kernel-monitor.json`](https://github.com/kubernetes/node-problem-detector/blob/master/config/kernel-monitor.json) as an example).
The rule list is extensible.

## Limitations
## Supported sources

* System Log Monitor only supports file based log and journald now, but it is easy
to extend it with [new log watcher](#new-log-watcher)
* System Log Monitor currently supports file-based logs, journald, and kmsg.
Additional sources can be added by implementing a [new log
watcher](#new-log-watcher).

## Add New NodeConditions

Expand Down Expand Up @@ -44,10 +45,10 @@ with new rule definition:

System log monitor supports different log management tools with different log
watchers:
* [filelog](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/systemlogmonitor/logwatchers/filelog): Log watcher for
* [filelog](./logwatchers/filelog): Log watcher for
arbitrary file based log.
* [journald](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/systemlogmonitor/logwatchers/journald): Log watcher for
journald.
* [journald](.//logwatchers/journald): Log watcher for
* [kmsg](./logwatchers/kmsg): Log watcher for the kernel ring buffer device, /dev/kmsg.
Set `plugin` in the configuration file to specify log watcher.

### Plugin Configuration
Expand All @@ -66,6 +67,7 @@ Log watcher specific configurations are configured in `pluginConfig`.
* timestampFormat: The format of the timestamp. The format string is the time
`2006-01-02T15:04:05Z07:00` in the expected format. (See
[golang timestamp format](https://golang.org/pkg/time/#pkg-constants))
* **kmsg**

### Change Log Path

Expand All @@ -78,6 +80,6 @@ field in the configurtion file is the log path. You can always configure

### New Log Watcher

System log monitor uses [Log
Watcher](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/systemlogmonitor/logwatchers/types/log_watcher.go) to support different log management tools.
It is easy to implement a new log watcher.
System log monitor uses [Log Watcher](./logwatchers/types/log_watcher.go) to
support different log management tools. It is easy to implement a new log
watcher.

0 comments on commit 8d1158d

Please sign in to comment.