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
The script should be installed under `/usr/local/bin/kubectl-tmux_exec`by default. Please ensure the `bin` directory is in your `$PATH` environment variable.
29
+
Finally, ensure `/usr/local/bin/kubectl-tmux_exec` is in your `$PATH`.
33
30
34
31
### Krew
35
32
@@ -49,15 +46,17 @@ The script should be installed under `/usr/local/bin/kubectl-tmux_exec` by defau
49
46
50
47
2. Unpack the kubectl-tmux-exec-*.tar.gz file and copy all the files to a directory, `/usr/local/kubectl-tmux-exec` for instance.
51
48
52
-
3. Add the `bin/` directory to PATH. For example, add this line to your rc file: `export PATH="$PATH:/usr/local/kubectl-tmux-exec/bin"`.
49
+
3. Add the `bin/` directory to your `$PATH`. For example, add this line to your rc file: `export PATH="$PATH:/usr/local/kubectl-tmux-exec/bin"`.
53
50
54
51
4. Install the dependencies. ([Wiki: How-to-Install-Dependencies](https://github.com/predatorray/kubectl-tmux-exec/wiki/How-to-Install-Dependencies))
55
52
56
53
## Usage
57
54
58
-
To execute this script as a [plugin]((https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/)), a `kubectl`version prior to `1.12.0` is required and the latest version is preferred. Alternatively, you can also execute the script directly like `kubectl-tmux_exec [...ARGS]` if it is not supported.
55
+
Make sure you have `kubectl`≥ 1.12 ([plugin support]), ideally latest.
59
56
60
-
By executing the command below, you can check if the script has been successfully added.
57
+
Otherwise, execute the script directly: `kubectl-tmux_exec [...ARGS]`.
58
+
59
+
Check if the script has been successfully added by:
61
60
62
61
```sh
63
62
kubectl plugin list
@@ -84,22 +83,22 @@ kubectl-tmux_exec --help
84
83
85
84
### Options
86
85
87
-
Flag | Usage
88
-
--- | ---
89
-
`-V`<br>`--version` | Print the version information
90
-
`-l`<br>`--selector` | Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)<br>You must either use `--selector` or `--file` option.
91
-
`-f`<br>`--file` | Read pod names line-by-line from a file.<br>You must either use `--selector` or `--file` option.
92
-
`-c`<br>`--container` | Container name. If omitted, the first container in the pod will be chosen
93
-
`-i`<br>`--stdin` | Pass stdin to the container (**deprecated**, since it's enabled by default)
94
-
`-t`<br>`--tty` | Stdin is a TTY (**deprecated**, since it's enabled by default)
95
-
`-d`<br>`--detach` | Make the Tmux session detached
96
-
`-n`<br>`--namespace=` | The namespace scope for this CLI request (can be applied multiple times)
97
-
`--context` | The name of the kubeconfig context to use (can be applied multiple times)
98
-
`-A`<br>`--all-namespaces` | If present, list and execute the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
99
-
`-C`<br>`--enable-control-mode` | Start tmux in control mode and echo is disabled. (See: [iTerm2 Integration](#iterm2-integration))
100
-
`--remain-on-exit` | Remain Tmux window on exit
101
-
`--select-layout` | One of the five Tmux preset layouts: even-horizontal, even-vertical, main-horizontal, main-vertical, or tiled.
102
-
`--session-mode` | Where tmux is opened: auto, new-session, current-session
|`-V`<br>`--version`| Print the version information|
89
+
|`-l`<br>`--selector`| Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)<br>You must either use `--selector` or `--file` option.|
90
+
|`-f`<br>`--file`| Read pod names line-by-line from a file.<br>You must either use `--selector` or `--file` option.|
91
+
|`-c`<br>`--container`| Container name. If omitted, the first container in the pod will be chosen|
92
+
|`-i`<br>`--stdin`| Pass stdin to the container (**deprecated**, since it's enabled by default)|
93
+
|`-t`<br>`--tty`| Stdin is a TTY (**deprecated**, since it's enabled by default)|
94
+
|`-d`<br>`--detach`| Make the Tmux session detached|
95
+
|`-n`<br>`--namespace=`| The namespace scope for this CLI request (can be applied multiple times)|
96
+
|`--context`| The name of the kubeconfig context to use (can be applied multiple times)|
97
+
|`-A`<br>`--all-namespaces`| If present, list and execute the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.|
98
+
|`-C`<br>`--enable-control-mode`| Start tmux in control mode and echo is disabled. (See: [iTerm2 Integration](#iterm2-integration))|
99
+
|`--remain-on-exit`| Remain Tmux window on exit|
100
+
|`--select-layout`| One of the five Tmux preset layouts: even-horizontal, even-vertical, main-horizontal, main-vertical, or tiled.|
101
+
|`--session-mode`| Where tmux is opened: auto, new-session, current-session|
103
102
104
103
The usage of these options is also available by `--help`.
105
104
@@ -119,22 +118,21 @@ If you are not familar with Tmux, you can have a look at tmux's man page or onli
119
118
120
119
### iTerm2 Integration
121
120
122
-
Since [iTerm2](https://iterm2.com/index.html) has been [integrated with tmux](https://iterm2.com/documentation-tmux-integration.html), we can have a better native user interface, instead of remembering all the shortcuts.
121
+
With `-C` or `--enable-control-mode`, it runs in control mode and delegates pane input to [iTerm2]'s "Broadcast Input" feature,
122
+
no need for tmux key bindings.
123
+
124
+
Use <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>i</kbd> to toggle broadcasting in iTerm2. (`synchronize-panes` will be disabled automatically in this mode.)
123
125
124
-
All we have to do is to turn on the Control Mode, by adding the option `-C` / `--enable-control-mode` when executing the script. After that, the iTerm2 application will take full control of the tmux session.
126
+
(see: [tmux Integration](https://iterm2.com/documentation-tmux-integration.html) for more information)
125
127
126
-
For example, executing the commands below in an iTerm2 session
128
+
#### Example
127
129
128
130
```sh
129
131
kubectl tmux-exec -C -l app=nginx /bin/bash
130
132
```
131
133
132
-
will result in something like the screenshot below.
Note that, the `synchronize-panes` will be disabled automatically in this mode, since the iTerm2 provides a much easier way to achieve this. To turn this on, press <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>i</kbd>, or click *"Shell"* - *"Broadcast Input"* - *"Broadcast Input to All Panes in Current Tab"* in the menu bar.
137
-
138
136
### Shell Auto-completion
139
137
140
138
Please check [this wiki](https://github.com/predatorray/kubectl-tmux-exec/wiki/Shell-Auto-completion) for more information.
@@ -155,20 +153,21 @@ All Tmux command starts with a `PREFIX`. By default the `PREFIX` is <kbd>Ctrl</k
155
153
156
154
`C-b &y`, close the window including all panes.
157
155
158
-
## Discussion & Support
159
-
160
-
Please feel free to [open an issue](https://github.com/predatorray/kubectl-tmux-exec/issues/new) if you find any bug or have any suggestion.
156
+
## Community & Support
161
157
162
-
Alternatively, join the [Google Group](https://groups.google.com/g/kubectl-tmux-exec) and start a conversation.
158
+
- File issues or feature requests via [GitHub Issues]((https://github.com/predatorray/kubectl-tmux-exec/issues/new))
159
+
- Join the [Google Group](https://groups.google.com/g/kubectl-tmux-exec) for discussions
163
160
164
161
## Other plugins
165
162
166
163
[kubectl-alias](https://github.com/predatorray/kubectl-alias): the missing alias command for kubectl.
167
164
168
165
## Buy Me a Coffee
169
166
170
-
If you find this tool useful,[buy me a coffee]. Thanks!
167
+
If it saves you time, feel free to[buy me a coffee] 🙌
171
168
172
169
[][buy me a coffee]
173
170
174
171
[buy me a coffee]: https://buymeacoffee.com/predatorray
0 commit comments