Skip to content

Commit

Permalink
document running custom commands
Browse files Browse the repository at this point in the history
  • Loading branch information
nilic committed Dec 31, 2022
1 parent 41cabf1 commit 094327a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,14 @@ $ kubectl netshoot debug my-existing-pod --image-tag v0.5
$ kubectl netshoot debug node/my-node
```

Instead of attaching to the shell, you can also run a command on directly on the `netshoot` container. The command you want to run is specified after `--`:

```
$ kubectl netshoot run tmp-shell -- ping 8.8.8.8
```

```
$ kubectl netshoot debug mypod -- curl localhost:8443
```

For more info on `netshoot` and provided tools please take a look at [nicolaka/netshoot](https://github.com/nicolaka/netshoot) Github repo.
4 changes: 2 additions & 2 deletions cmd/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Flags:

debugUsage = `
Usage:
kubectl netshoot debug (POD | TYPE[[.VERSION].GROUP]/NAME) [flags]`
kubectl netshoot debug (POD | TYPE[[.VERSION].GROUP]/NAME) [flags] [ -- COMMAND [args...] ]`

runFlags = `
Flags:
Expand All @@ -48,7 +48,7 @@ Flags:

runUsage = `
Usage:
kubectl netshoot run NAME [flags]`
kubectl netshoot run NAME [flags] [ -- COMMAND [args...] ]`
)

var (
Expand Down

0 comments on commit 094327a

Please sign in to comment.