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
+61-16Lines changed: 61 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,54 @@ Cons:
23
23
24
24
## Enable webhooks in Logging operator {#enable-webhooks}
25
25
26
-
> We recommend using `cert-manager` to manage your certificates. Since using `cert-manager` is not part of this article, we assume you already have valid certs.
26
+
> We recommend using `cert-manager` to manage your certificates. Below is a really simple command that bootstraps generates the required resources for the `tailer-webhook`.
27
+
### Issuing certificates using `cert-manager` {#issue-certificate-cert-manager}
28
+
29
+
Follow the [official installation guide](https://cert-manager.io/docs/installation/).
30
+
31
+
Once installed the following commands should allow you to create the required certificate for the webhook.
@@ -159,7 +207,7 @@ To trigger the webhook, add the following annotation to the pod metadata:
159
207
160
208
### File tailer example
161
209
162
-
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.
210
+
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.
163
211
164
212
```yaml
165
213
apiVersion: v1
@@ -170,16 +218,13 @@ metadata:
170
218
spec:
171
219
containers:
172
220
- image: debian
173
-
name: sample-container
174
-
command: ["/bin/sh", "-c"]
175
-
args:
176
-
- while true; do
177
-
date >> /var/log/date;
178
-
sleep 1;
179
-
done
180
-
- image: debian
181
-
name: sample-container2
182
-
...
221
+
name: sample-container
222
+
command: ["/bin/sh", "-c"]
223
+
args:
224
+
- while true; do
225
+
date >> /var/log/date;
226
+
sleep 1;
227
+
done
183
228
```
184
229
185
230
After you have created the pod with the required annotation, make sure that the `test-pod` contains two containers by running `kubectl get pod`
@@ -201,15 +246,15 @@ Expected output:
201
246
202
247
```bash
203
248
[
204
-
"test",
205
-
"legacy-logs-date-log"
249
+
"sample-container",
250
+
"sample-container-var-log-date"
206
251
]
207
252
```
208
253
209
254
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