You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/configuration/extensions/tailer-webhook.md
+11-14Lines changed: 11 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,7 +160,7 @@ To trigger the webhook, add the following annotation to the pod metadata:
160
160
161
161
### File tailer example
162
162
163
-
The following example creates a pod that is running a shell in infinite loop that appends the `date` command's output to a file every second. The annotation `sidecar.logging-extensions.banzaicloud.io/tail` notifies Logging operator to attach a sidecar container to the pod. The sidecar tails the `/legacy-logs/date.log` file and sends its output to the stdout.
163
+
The following example creates a pod that is running a shell in infinite loop that appends the `date` command's output to a file every second. The annotation `sidecar.logging-extensions.banzaicloud.io/tail` notifies Logging operator to attach a sidecar container to the pod. The sidecar tails the `/var/log/date` file and sends its output to the stdout.
164
164
165
165
```yaml
166
166
apiVersion: v1
@@ -171,16 +171,13 @@ metadata:
171
171
spec:
172
172
containers:
173
173
- image: debian
174
-
name: sample-container
175
-
command: ["/bin/sh", "-c"]
176
-
args:
177
-
- while true; do
178
-
date >> /var/log/date;
179
-
sleep 1;
180
-
done
181
-
- image: debian
182
-
name: sample-container2
183
-
...
174
+
name: sample-container
175
+
command: ["/bin/sh", "-c"]
176
+
args:
177
+
- while true; do
178
+
date >> /var/log/date;
179
+
sleep 1;
180
+
done
184
181
```
185
182
186
183
After you have created the pod with the required annotation, make sure that the `test-pod` contains two containers by running `kubectl get pod`
@@ -202,15 +199,15 @@ Expected output:
202
199
203
200
```bash
204
201
[
205
-
"test",
206
-
"legacy-logs-date-log"
202
+
"sample-container",
203
+
"sample-container-var-log-date"
207
204
]
208
205
```
209
206
210
207
Check the logs of the `test` container. Since it writes the logs into a file, it does not produce any logs on stdout.
0 commit comments