Skip to content

Commit 61c1f96

Browse files
committed
Update README
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 3af351c commit 61c1f96

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,25 @@ By default, the base filename is going to be printed as a prefix for each tailed
5353

5454
To suppress the prefix, run the command with `FS_PREFIX=0`.
5555

56+
### Tail container logs from Kubernetes
57+
58+
The kubelet with K3s will create log files for containers in `/var/log/containers` with long prefixes, the `FS_PREFIX=k8s` env-var can be used to redact the string.
59+
60+
Any text passed after the folder forms a grep for the filenames, so here, we are only looking at "queue-worker" containers.
61+
62+
Note that these files do not receive a "WRITE" fsnotify event, only an initial "CREATE".
63+
64+
```bash
65+
FS_PREFIX=k8s sudo -E fstail /var/log/containers/ "queue-worker"
66+
67+
2025/03/12 07:39:23 Attaching to: queue-worker-6b579d58d7-krgx5_openfaas_queue-worker-08e45f83b4f6edbd9ae2182f6709ccfb28e3e5871b5cc0d303c20c4c7b2a3d56.log
68+
2025/03/12 07:39:23 Attaching to: queue-worker-6b579d58d7-krgx5_openfaas_queue-worker-f03309cc46a9752a4366062da18872ee215cc1837dcb335fa0d339948f3d9609.log
69+
queue-worker-6b579d58d7-krgx5| 2025-03-10T12:40:45.84048421Z stderr F 2025-03-10T12:40:45.838Z info jetstream-queue-worker/main.go:118 JetStream queue-worker {"version": "0.3.46", "gitCommit": "8320975de6c98c8b6ef6781e2db610cc389c7e33"}
70+
queue-worker-6b579d58d7-krgx5| 2025-03-10T12:40:45.840510746Z stderr F 2025-03-10T12:40:45.838Z info jetstream-queue-worker/main.go:120 Licensed to: Alex Ellis
71+
queue-worker-6b579d58d7-krgx5| 2025-03-10T12:40:45.840514335Z stderr F
72+
queue-worker-6b579d58d7-krgx5| 2025-03-10T12:40:45.840517017Z stderr F 2025-03-10T12:40:45.839Z info metrics/metrics.go:79 Starting metrics server on port 8081
73+
```
74+
5675
### Installation
5776

5877
Download a release binary:

0 commit comments

Comments
 (0)