File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -5,16 +5,26 @@ Start a root shell in the node's host OS running.
5
5
6
6
## Installation
7
7
8
- ```
8
+ ``` bash
9
9
curl -LO https://github.com/kvaps/kubectl-node-shell/raw/master/kubectl-node_shell
10
10
chmod +x ./kubectl-node_shell
11
11
sudo mv ./kubectl-node_shell /usr/local/bin/kubectl-node_shell
12
12
```
13
13
14
14
## Usage
15
15
16
- ```
16
+ ``` bash
17
+ # Get standard bash shell
17
18
kubectl node-shell < node>
19
+
20
+ # Execute custom command
21
+ kubectl node-shell < node> -- echo 123
22
+
23
+ # Use stdin
24
+ cat /etc/passwd | kubectl node-shell < node> -- sh -c ' cat > /tmp/passwd'
25
+
26
+ # Run oneliner
27
+ kubectl node-shell < node> -- sh -c ' cat /tmp/passwd; rm -f /tmp/passwd'
18
28
```
19
29
20
30
* You need to be able to start privileged containers for that.*
You can’t perform that action at this time.
0 commit comments