diff options
author | Staffan Olsson <staffan@repos.se> | 2017-11-04 15:14:39 +0100 |
---|---|---|
committer | Staffan Olsson <staffan@repos.se> | 2017-11-04 15:23:06 +0100 |
commit | 0dcde3e7af05f166890228c351f232c1b82a858d (patch) | |
tree | a6db567353af7a7494d792359b9d9dc7307706e5 | |
parent | 9446d4a9d32af760e1e87b27afa4c0be60fe154f (diff) | |
download | kubernetes-kafka-0dcde3e7af05f166890228c351f232c1b82a858d.tar.gz kubernetes-kafka-0dcde3e7af05f166890228c351f232c1b82a858d.tar.bz2 kubernetes-kafka-0dcde3e7af05f166890228c351f232c1b82a858d.zip |
We'll lose some lines at restart, but we'll pick up new containers ...
actually getting amazingly close to the result from filebeat or fluentd.
The `==> [filename] <==` messages give the filename for coming nessages
up to the next such line (thanks to `tail`) and the filenames all have the pattern
pod-name_namespace_container-name_id.log
A streams application could process this and pass messages to another
topic, after adding labels and annotations from kube API, either as very long keys
or wrapping as json like fluentd or filebeat does.
-rw-r--r-- | logs-streaming/logs-kube-kafka.yml | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/logs-streaming/logs-kube-kafka.yml b/logs-streaming/logs-kube-kafka.yml index f9d0e8a..423c2d7 100644 --- a/logs-streaming/logs-kube-kafka.yml +++ b/logs-streaming/logs-kube-kafka.yml @@ -23,6 +23,7 @@ spec: - sh - -ec - > + find /var/log/containers/ -maxdepth 1 -name *.log | tee /tmp/start-list; cd /var/log/containers/; tail -n 0 @@ -36,6 +37,14 @@ spec: -z snappy -v -d broker,topic + livenessProbe: + exec: + command: + - /bin/sh + - -c + - find /var/log/containers/ -maxdepth 1 -name *.log | diff - /tmp/start-list + initialDelaySeconds: 5 + periodSeconds: 5 resources: limits: memory: 100Mi |