Skip to content

Commit 198c17d

Browse files
committed
add more examples
1 parent 841cb37 commit 198c17d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,26 @@ Start a root shell in the node's host OS running.
55

66
## Installation
77

8-
```
8+
```bash
99
curl -LO https://github.com/kvaps/kubectl-node-shell/raw/master/kubectl-node_shell
1010
chmod +x ./kubectl-node_shell
1111
sudo mv ./kubectl-node_shell /usr/local/bin/kubectl-node_shell
1212
```
1313

1414
## Usage
1515

16-
```
16+
```bash
17+
# Get standard bash shell
1718
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'
1828
```
1929

2030
*You need to be able to start privileged containers for that.*

0 commit comments

Comments
 (0)