@@ -14,15 +14,15 @@ An interactive Kubernetes log viewer for your terminal.
14
14
* Select containers interactively or auto-select by pattern matching against names, labels, and more
15
15
* See cluster changes in real time
16
16
* Navigate logs from multiple containers interleaved by timestamp
17
- * Search logs by exact string or regex pattern. Include surrounding context or show matching lines only
17
+ * Search logs by exact string or regex pattern. Show or hide surrounding context
18
18
* Zoom in and flip through single formatted logs one by one
19
19
* Archive and share: save logs to a local file or copy a log to your clipboard
20
20
21
21
Comparable to:
22
22
23
- * [ k9s] ( https://k9scli.io/ ) but focused on logs
24
23
* [ kubectl logs] ( https://kubernetes.io/docs/reference/kubectl/generated/kubectl_logs/ ) supercharged
25
- * [ stern] ( https://github.com/stern/stern ) & [ kail] ( https://github.com/boz/kail ) but multi-cluster and an interactive
24
+ * [ k9s] ( https://k9scli.io/ ) but specializing in logs
25
+ * [ stern] ( https://github.com/stern/stern ) & [ kail] ( https://github.com/boz/kail ) but multi-cluster and with an interactive
26
26
interface
27
27
28
28
## Usage
@@ -32,66 +32,67 @@ Comparable to:
32
32
Examples:
33
33
34
34
``` shell
35
- # Use the current kubernetes context. If context namespace doesn't exist, uses `default`
35
+ # Use the current kubernetes context, defaulting to `default`
36
36
kl
37
37
38
38
# Use context `my-context`, all namespaces
39
39
kl --context my-context -A
40
40
41
- # Use contexts `my-context` & `other-context`, namespaces `default` & `other-ns` in each
41
+ # Use contexts `my-context` & `other-context`, namespaces `default` & `other-ns` in each context
42
42
kl --context my-context,other-context -n default,other-ns
43
43
44
- # Auto-select all containers in a with a pod owner (e.g. deployment) containing the word `nginx`
44
+ # Auto-select containers with a pod owner (e.g. deployment) containing the word `nginx`
45
45
kl --mown nginx
46
46
47
- # Auto-select all containers with the exact name of `my-container`, limited to 10 selections
47
+ # Auto-select containers with the exact name `my-container`, limited to 10 containers
48
48
kl --mc " ^my-container$" --limit 10
49
49
50
- # Auto-select all containers that have labels app=flask and either tier=stage or tier=prod
50
+ # Auto-select containers that have labels app=flask and either tier=stage or tier=prod
51
51
kl -l ' app=flask,tier in (stage, prod)'
52
52
53
- # Ignore all containers with the exact name of `my-sidecar`
53
+ # Ignore containers with the exact name of `my-sidecar`
54
54
kl --ic " ^my-sidecar$"
55
55
56
- # Start on the logs page , ordered by timestamp descending, showing logs from 10 minutes ago onwards
56
+ # Start focused on logs, ordered by timestamp descending, showing logs from 10 minutes ago onwards
57
57
kl --mc " ^my-container$" -d --logs-view --since 10m
58
58
```
59
59
60
60
Press ` ? ` in any view to see keyboard shortcuts specific to the current view and across the application.
61
61
62
- | Key | Action |
63
- | --------| -------------------------------------------------|
64
- | ↓/j | down one line |
65
- | ↑/k | up one line |
66
- | d | down half page |
67
- | u | up half page |
68
- | f | down full page |
69
- | b | up full page |
70
- | g | go to top (will follow logs if descending) |
71
- | G | go to bottom (will follow logs if ascending) |
72
- | l | focus on logs view |
73
- | L | focus on logs view in fullscreen |
74
- | enter | zoom in to single log view for selected log |
75
- | esc | back to all logs view when viewing single log |
76
- | s | focus on container selection view |
77
- | S | focus on container selection view in fullscreen |
78
- | F | toggle fullscreen |
79
- | / | edit exact match filter |
80
- | r | edit regex filter |
81
- | enter | when filtering, apply filter |
82
- | esc | discard applied filter |
83
- | n | next filter match |
84
- | N | previous filter match |
85
- | x | toggle showing only the logs matching filter |
86
- | w | toggle line wrap |
87
- | o | reverse timestamp ordering |
88
- | p | pause/resume log stream |
89
- | t | change timestamp format |
90
- | c | change container name format |
91
- | 0-9 | change time from which logs begin |
92
- | ctrl+s | save focused view to local file |
93
- | ctrl+y | in single log view, copy to clipboard |
94
- | ? | show/hide help |
62
+ | Key | Action |
63
+ | ---------| -------------------------------------------------|
64
+ | ↓/j | down one line |
65
+ | ↑/k | up one line |
66
+ | d | down half page |
67
+ | u | up half page |
68
+ | f | down full page |
69
+ | b | up full page |
70
+ | g | go to top (will follow logs if descending) |
71
+ | G | go to bottom (will follow logs if ascending) |
72
+ | l | focus on logs view |
73
+ | L | focus on logs view in fullscreen |
74
+ | enter | zoom in to single log view for selected log |
75
+ | esc | back to all logs view when viewing single log |
76
+ | s | focus on container selection view |
77
+ | S | focus on container selection view in fullscreen |
78
+ | F | toggle fullscreen |
79
+ | / | edit exact match filter |
80
+ | r | edit regex filter |
81
+ | enter | when filtering, apply filter |
82
+ | esc | discard applied filter |
83
+ | n | next filter match |
84
+ | N | previous filter match |
85
+ | x | toggle showing only the logs matching filter |
86
+ | w | toggle line wrap |
87
+ | ←/→/h/l | pan left/right when not wrapped |
88
+ | o | reverse timestamp ordering |
89
+ | p | pause/resume log stream |
90
+ | t | change timestamp format |
91
+ | c | change container name format |
92
+ | 0-9 | change time from which logs begin |
93
+ | ctrl+s | save focused view to local file |
94
+ | ctrl+y | in single log view, copy to clipboard |
95
+ | ? | show/hide help |
95
96
96
97
## Installation
97
98
@@ -150,7 +151,7 @@ cd kl
150
151
go build # outputs ./kl executable
151
152
```
152
153
153
- Running a an example flask + postgres + nginx setup in a local [ k3d] ( https://k3d.io/ ) cluster for testing locally:
154
+ Run an example flask + postgres + nginx setup in a local [ k3d] ( https://k3d.io/ ) cluster for testing locally:
154
155
155
156
``` sh
156
157
k3d cluster create test
0 commit comments