kdebug 0.6.7__tar.gz → 0.6.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kdebug
3
- Version: 0.6.7
3
+ Version: 0.6.8
4
4
  Summary: TUI for Kubernetes Debug Containers
5
5
  Project-URL: Homepage, https://github.com/jessegoodier/kdebug
6
6
  Project-URL: Repository, https://github.com/jessegoodier/kdebug
@@ -17,13 +17,42 @@ Requires-Python: >=3.9
17
17
  Requires-Dist: rich>=14.0
18
18
  Description-Content-Type: text/markdown
19
19
 
20
- # kdebug - Universal Kubernetes Debug and File Copy Container Utility
20
+ # kdebug
21
21
 
22
- Simple utility for launching ephemeral debug containers in Kubernetes pods with interactive shell access, backup capabilities, and a colorful TUI for pod selection.
22
+ `kdebug` is a helper utility for launching ephemeral Kubernetes debug containers and backing up files. It provides interactive shell access, backup workflows, and a TUI for pod selection.
23
23
 
24
- Similar to [kpf](https://github.com/jessegoodier/kpf), this is a python wrapper around `kubectl debug` and `kubectl cp`.
24
+ When the target container is missing the tools you need, `kdebug` shortens the `kubectl debug` and `kubectl cp` flow into easy to understand commands.
25
25
 
26
- >Notice: the default debug container image is <https://github.com/jessegoodier/toolbox/tree/main/common> and may not be ideal for all users. This is configurable both with an arg and a global config file
26
+ For example, to run a debug container to look at the Grafana filesystem, you'd need to know all of these details:
27
+
28
+ ```sh
29
+ kubectl debug kube-prometheus-stack-grafana-d4f497446-kbqc8 \
30
+ -n monitoring \
31
+ -it \
32
+ --target=grafana \
33
+ --share-processes \
34
+ --profile=general \
35
+ --image=busybox \
36
+ -- /bin/sh
37
+ ```
38
+
39
+ And then, to get to the container's filesystem, you'd need to run `cd /proc/1/root/etc/grafana`.
40
+
41
+ Instead:
42
+
43
+ ```sh
44
+ kdebug -n monitoring --cd-into /etc/grafana
45
+ ```
46
+
47
+ tldr; install:
48
+
49
+ ```sh
50
+ brew install jessegoodier/kdebug/kdebug
51
+ ```
52
+
53
+ Similar to [kpf](https://github.com/jessegoodier/kpf), this is a Python wrapper around `kubectl debug` and `kubectl cp`.
54
+
55
+ > Notice: the default debug image is [ghcr.io/jessegoodier/toolbox-common:latest](https://github.com/jessegoodier/toolbox/tree/main/common). Override it with `--debug-image` or a global config file if that image is not appropriate for your needs.
27
56
 
28
57
  ## Features
29
58
 
@@ -31,9 +60,9 @@ Similar to [kpf](https://github.com/jessegoodier/kpf), this is a python wrapper
31
60
  - 💾 **Backup Capabilities** - Copy files/directories from pods with optional compression and configurable local paths
32
61
  - 🔍 **Multiple Selection Modes** - Direct pod, controller-based, or interactive TUI
33
62
  - 🎯 **Smart Container Selection** - Auto-select containers or choose specific targets
34
- - 🔐 **Root Access Support** - Run debug containers as root when needed
35
- - 📦 **Controller Support** - Works with Deployments, StatefulSets, and DaemonSets
63
+ - 📦 **Backup Size Estimates** - Understand how much data you backing up
36
64
  - ⚙️ **Config File** - Set defaults for debug image, shell command, and backup paths
65
+ - 🔐 **Command Completion** - Automatically installed with brew, otherwise `--completion zsh/bash/fish`
37
66
 
38
67
  <details open>
39
68
  <summary>Demo of the debug TUI</summary>
@@ -49,50 +78,62 @@ Similar to [kpf](https://github.com/jessegoodier/kpf), this is a python wrapper
49
78
 
50
79
  ## Installation
51
80
 
81
+ ### Homebrew
82
+
52
83
  ```bash
53
84
  brew install jessegoodier/kdebug/kdebug
54
85
  ```
55
86
 
87
+ ### Python tools
88
+
89
+ ```
90
+ # uv
91
+ uv tool install kdebug
92
+
93
+ # pip
94
+ pip install kdebug
95
+ ```
96
+
56
97
  ## Usage
57
98
 
58
- kdebug uses subcommands for its two modes of operation:
99
+ `kdebug` has two modes of operation:
59
100
 
60
101
  ```
61
102
  kdebug debug [options] # Interactive debug session (default)
62
103
  kdebug backup [options] # Backup files from pod
63
- kdebug [options] # Same as "kdebug debug" for convenience
104
+ kdebug [options] # Same as "kdebug debug"
64
105
  ```
65
106
 
66
107
  ### Global Options
67
108
 
68
- These shared options work with both subcommands:
109
+ These shared options work with both `debug` and `backup`:
69
110
 
70
111
  ```bash
71
112
  # Use a specific context
72
113
  kdebug --context minikube -n default --pod my-pod
73
114
 
74
115
  # Use a different kubeconfig file
75
- kdebug --kubeconfig .kubeconfig -n openclaw
116
+ kdebug --kubeconfig .kubeconfig -n my-app
76
117
 
77
118
  # Combine both options
78
- kdebug --kubeconfig /path/to/config --context staging -n myapp --pod api-0
119
+ kdebug --kubeconfig /path/to/config --context staging -n my-app --pod my-pod
79
120
  ```
80
121
 
81
122
  ### Interactive Mode (TUI)
82
123
 
83
- When no pod or controller is specified, kdebug launches an interactive menu system:
124
+ When no pod or controller is specified, `kdebug` launches an interactive menu:
84
125
 
85
126
  ```bash
86
127
  # Interactive mode - select from all resources in current namespace
87
128
  kdebug
88
129
 
89
130
  # Interactive mode with specific namespace
90
- kdebug -n openclaw
131
+ kdebug -n my-app
91
132
  ```
92
133
 
93
134
  ### Debug Subcommand
94
135
 
95
- The `debug` subcommand (or naked `kdebug`) launches an interactive shell session in an ephemeral debug container.
136
+ The `debug` subcommand, or bare `kdebug`, launches an interactive shell session in an ephemeral debug container.
96
137
 
97
138
  ```bash
98
139
  # Interactive session with direct pod (bare usage = debug)
@@ -117,6 +158,8 @@ kdebug debug -n kubecost --pod aggregator-0 --cd-into /var/configs
117
158
 
118
159
  ### Controller-Based Selection
119
160
 
161
+ Avoid the TUI and launch with direct commands:
162
+
120
163
  ```bash
121
164
  # Using StatefulSet (sts)
122
165
  kdebug --controller sts/aggregator --container aggregator
@@ -137,6 +180,8 @@ kdebug -n logging --controller ds/fluentd
137
180
 
138
181
  The `backup` subcommand copies files or directories from a pod to your local machine.
139
182
 
183
+ This supports both copying files as is to the client, or optionally use tar+gz to compress the files in container before copying.
184
+
140
185
  ```bash
141
186
  # Backup a directory (uncompressed)
142
187
  kdebug backup -n kubecost --pod aggregator-0 --container-path /var/configs
@@ -245,16 +290,13 @@ Since busybox doesn't include bash, set `cmd` to `sh`. With this config, simply
245
290
 
246
291
  ## Shell Completion
247
292
 
248
- kdebug supports tab completion for bash and zsh with dynamic lookups for namespaces, pods, controller names, and subcommands.
293
+ `kdebug` supports tab completion for bash, zsh, and fish with dynamic lookups for namespaces, pods, controller names, and contexts.
249
294
 
250
295
  ### Bash
251
296
 
252
297
  ```bash
253
298
  # Add to ~/.bashrc
254
299
  source <(kdebug --completions bash)
255
-
256
- # Or source the file directly
257
- source /path/to/kdebug/completions/kdebug.bash
258
300
  ```
259
301
 
260
302
  ### Zsh
@@ -271,6 +313,16 @@ fpath=(~/.zsh/completions $fpath)
271
313
  autoload -Uz compinit && compinit
272
314
  ```
273
315
 
316
+ ### Fish
317
+
318
+ ```fish
319
+ # Load for current shell
320
+ kdebug --completions fish | source
321
+
322
+ # Or install permanently
323
+ kdebug --completions fish > ~/.config/fish/completions/kdebug.fish
324
+ ```
325
+
274
326
  ### Completion Features
275
327
 
276
328
  - `kdebug <TAB>` - Complete subcommands (`debug`, `backup`)
@@ -279,7 +331,7 @@ autoload -Uz compinit && compinit
279
331
  - `kdebug backup --<TAB>` - Complete backup-specific options
280
332
  - `kdebug -n <TAB>` - Complete namespace names from cluster
281
333
  - `kdebug --pod <TAB>` - Complete pod names (respects -n flag)
282
- - `kdebug --controller <TAB>` - Complete controller types and names
334
+ - `kdebug --controller <TAB>` - Complete controller type/name pairs
283
335
  - `kdebug --context <TAB>` - Complete context names from kubeconfig
284
336
 
285
337
  ## Examples
@@ -356,6 +408,7 @@ kdebug uses a kubecolor-inspired color scheme:
356
408
  ## Requirements
357
409
 
358
410
  - Python 3.9+
411
+ - `rich` is installed automatically with the Python package
359
412
  - kubectl configured with cluster access
360
413
  - Kubernetes cluster with ephemeral containers support (v1.23+)
361
414
 
@@ -399,6 +452,4 @@ MIT
399
452
 
400
453
  Contributions welcome! Please open issues or pull requests.
401
454
 
402
- ---
403
-
404
- Made with ❤️ and Bob
455
+ See [README-development.md](README-development.md) for local setup, linting, tests, and helper `just` commands.
@@ -1,10 +1,39 @@
1
- # kdebug - Universal Kubernetes Debug and File Copy Container Utility
1
+ # kdebug
2
2
 
3
- Simple utility for launching ephemeral debug containers in Kubernetes pods with interactive shell access, backup capabilities, and a colorful TUI for pod selection.
3
+ `kdebug` is a helper utility for launching ephemeral Kubernetes debug containers and backing up files. It provides interactive shell access, backup workflows, and a TUI for pod selection.
4
4
 
5
- Similar to [kpf](https://github.com/jessegoodier/kpf), this is a python wrapper around `kubectl debug` and `kubectl cp`.
5
+ When the target container is missing the tools you need, `kdebug` shortens the `kubectl debug` and `kubectl cp` flow into easy to understand commands.
6
6
 
7
- >Notice: the default debug container image is <https://github.com/jessegoodier/toolbox/tree/main/common> and may not be ideal for all users. This is configurable both with an arg and a global config file
7
+ For example, to run a debug container to look at the Grafana filesystem, you'd need to know all of these details:
8
+
9
+ ```sh
10
+ kubectl debug kube-prometheus-stack-grafana-d4f497446-kbqc8 \
11
+ -n monitoring \
12
+ -it \
13
+ --target=grafana \
14
+ --share-processes \
15
+ --profile=general \
16
+ --image=busybox \
17
+ -- /bin/sh
18
+ ```
19
+
20
+ And then, to get to the container's filesystem, you'd need to run `cd /proc/1/root/etc/grafana`.
21
+
22
+ Instead:
23
+
24
+ ```sh
25
+ kdebug -n monitoring --cd-into /etc/grafana
26
+ ```
27
+
28
+ tldr; install:
29
+
30
+ ```sh
31
+ brew install jessegoodier/kdebug/kdebug
32
+ ```
33
+
34
+ Similar to [kpf](https://github.com/jessegoodier/kpf), this is a Python wrapper around `kubectl debug` and `kubectl cp`.
35
+
36
+ > Notice: the default debug image is [ghcr.io/jessegoodier/toolbox-common:latest](https://github.com/jessegoodier/toolbox/tree/main/common). Override it with `--debug-image` or a global config file if that image is not appropriate for your needs.
8
37
 
9
38
  ## Features
10
39
 
@@ -12,9 +41,9 @@ Similar to [kpf](https://github.com/jessegoodier/kpf), this is a python wrapper
12
41
  - 💾 **Backup Capabilities** - Copy files/directories from pods with optional compression and configurable local paths
13
42
  - 🔍 **Multiple Selection Modes** - Direct pod, controller-based, or interactive TUI
14
43
  - 🎯 **Smart Container Selection** - Auto-select containers or choose specific targets
15
- - 🔐 **Root Access Support** - Run debug containers as root when needed
16
- - 📦 **Controller Support** - Works with Deployments, StatefulSets, and DaemonSets
44
+ - 📦 **Backup Size Estimates** - Understand how much data you backing up
17
45
  - ⚙️ **Config File** - Set defaults for debug image, shell command, and backup paths
46
+ - 🔐 **Command Completion** - Automatically installed with brew, otherwise `--completion zsh/bash/fish`
18
47
 
19
48
  <details open>
20
49
  <summary>Demo of the debug TUI</summary>
@@ -30,50 +59,62 @@ Similar to [kpf](https://github.com/jessegoodier/kpf), this is a python wrapper
30
59
 
31
60
  ## Installation
32
61
 
62
+ ### Homebrew
63
+
33
64
  ```bash
34
65
  brew install jessegoodier/kdebug/kdebug
35
66
  ```
36
67
 
68
+ ### Python tools
69
+
70
+ ```
71
+ # uv
72
+ uv tool install kdebug
73
+
74
+ # pip
75
+ pip install kdebug
76
+ ```
77
+
37
78
  ## Usage
38
79
 
39
- kdebug uses subcommands for its two modes of operation:
80
+ `kdebug` has two modes of operation:
40
81
 
41
82
  ```
42
83
  kdebug debug [options] # Interactive debug session (default)
43
84
  kdebug backup [options] # Backup files from pod
44
- kdebug [options] # Same as "kdebug debug" for convenience
85
+ kdebug [options] # Same as "kdebug debug"
45
86
  ```
46
87
 
47
88
  ### Global Options
48
89
 
49
- These shared options work with both subcommands:
90
+ These shared options work with both `debug` and `backup`:
50
91
 
51
92
  ```bash
52
93
  # Use a specific context
53
94
  kdebug --context minikube -n default --pod my-pod
54
95
 
55
96
  # Use a different kubeconfig file
56
- kdebug --kubeconfig .kubeconfig -n openclaw
97
+ kdebug --kubeconfig .kubeconfig -n my-app
57
98
 
58
99
  # Combine both options
59
- kdebug --kubeconfig /path/to/config --context staging -n myapp --pod api-0
100
+ kdebug --kubeconfig /path/to/config --context staging -n my-app --pod my-pod
60
101
  ```
61
102
 
62
103
  ### Interactive Mode (TUI)
63
104
 
64
- When no pod or controller is specified, kdebug launches an interactive menu system:
105
+ When no pod or controller is specified, `kdebug` launches an interactive menu:
65
106
 
66
107
  ```bash
67
108
  # Interactive mode - select from all resources in current namespace
68
109
  kdebug
69
110
 
70
111
  # Interactive mode with specific namespace
71
- kdebug -n openclaw
112
+ kdebug -n my-app
72
113
  ```
73
114
 
74
115
  ### Debug Subcommand
75
116
 
76
- The `debug` subcommand (or naked `kdebug`) launches an interactive shell session in an ephemeral debug container.
117
+ The `debug` subcommand, or bare `kdebug`, launches an interactive shell session in an ephemeral debug container.
77
118
 
78
119
  ```bash
79
120
  # Interactive session with direct pod (bare usage = debug)
@@ -98,6 +139,8 @@ kdebug debug -n kubecost --pod aggregator-0 --cd-into /var/configs
98
139
 
99
140
  ### Controller-Based Selection
100
141
 
142
+ Avoid the TUI and launch with direct commands:
143
+
101
144
  ```bash
102
145
  # Using StatefulSet (sts)
103
146
  kdebug --controller sts/aggregator --container aggregator
@@ -118,6 +161,8 @@ kdebug -n logging --controller ds/fluentd
118
161
 
119
162
  The `backup` subcommand copies files or directories from a pod to your local machine.
120
163
 
164
+ This supports both copying files as is to the client, or optionally use tar+gz to compress the files in container before copying.
165
+
121
166
  ```bash
122
167
  # Backup a directory (uncompressed)
123
168
  kdebug backup -n kubecost --pod aggregator-0 --container-path /var/configs
@@ -226,16 +271,13 @@ Since busybox doesn't include bash, set `cmd` to `sh`. With this config, simply
226
271
 
227
272
  ## Shell Completion
228
273
 
229
- kdebug supports tab completion for bash and zsh with dynamic lookups for namespaces, pods, controller names, and subcommands.
274
+ `kdebug` supports tab completion for bash, zsh, and fish with dynamic lookups for namespaces, pods, controller names, and contexts.
230
275
 
231
276
  ### Bash
232
277
 
233
278
  ```bash
234
279
  # Add to ~/.bashrc
235
280
  source <(kdebug --completions bash)
236
-
237
- # Or source the file directly
238
- source /path/to/kdebug/completions/kdebug.bash
239
281
  ```
240
282
 
241
283
  ### Zsh
@@ -252,6 +294,16 @@ fpath=(~/.zsh/completions $fpath)
252
294
  autoload -Uz compinit && compinit
253
295
  ```
254
296
 
297
+ ### Fish
298
+
299
+ ```fish
300
+ # Load for current shell
301
+ kdebug --completions fish | source
302
+
303
+ # Or install permanently
304
+ kdebug --completions fish > ~/.config/fish/completions/kdebug.fish
305
+ ```
306
+
255
307
  ### Completion Features
256
308
 
257
309
  - `kdebug <TAB>` - Complete subcommands (`debug`, `backup`)
@@ -260,7 +312,7 @@ autoload -Uz compinit && compinit
260
312
  - `kdebug backup --<TAB>` - Complete backup-specific options
261
313
  - `kdebug -n <TAB>` - Complete namespace names from cluster
262
314
  - `kdebug --pod <TAB>` - Complete pod names (respects -n flag)
263
- - `kdebug --controller <TAB>` - Complete controller types and names
315
+ - `kdebug --controller <TAB>` - Complete controller type/name pairs
264
316
  - `kdebug --context <TAB>` - Complete context names from kubeconfig
265
317
 
266
318
  ## Examples
@@ -337,6 +389,7 @@ kdebug uses a kubecolor-inspired color scheme:
337
389
  ## Requirements
338
390
 
339
391
  - Python 3.9+
392
+ - `rich` is installed automatically with the Python package
340
393
  - kubectl configured with cluster access
341
394
  - Kubernetes cluster with ephemeral containers support (v1.23+)
342
395
 
@@ -380,6 +433,4 @@ MIT
380
433
 
381
434
  Contributions welcome! Please open issues or pull requests.
382
435
 
383
- ---
384
-
385
- Made with ❤️ and Bob
436
+ See [README-development.md](README-development.md) for local setup, linting, tests, and helper `just` commands.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "kdebug"
7
- version = "0.6.7"
7
+ version = "0.6.8"
8
8
  description = "TUI for Kubernetes Debug Containers"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -37,7 +37,7 @@ include = ["src/kdebug"]
37
37
  [dependency-groups]
38
38
  dev = [
39
39
  "pytest>=7.0",
40
- "ruff>=0.4",
40
+ "ruff>=0.15",
41
41
  ]
42
42
 
43
43
  [tool.pytest.ini_options]
File without changes
File without changes
File without changes
File without changes
File without changes