Add escape sequence for kubectl attach/run (#6740)

This commit is contained in:
Qiming 2018-01-26 06:12:34 +08:00 committed by k8s-ci-robot
parent dfa9bf566c
commit aad35d1d4e
1 changed files with 5 additions and 0 deletions

View File

@ -53,6 +53,8 @@ kubectl run [-i] [--tty] --attach <name> --image=<image>
```
Unlike `docker run ...`, if `--attach` is specified, we attach to `stdin`, `stdout` and `stderr`, there is no ability to control which streams are attached (`docker -a ...`).
To detach from the container, you can type the escape sequence which is Ctrl+P
followed by Ctrl+Q.
Because we start a Deployment for your container, it will be restarted if you terminate the attached process (e.g. `ctrl-c`), this is different from `docker run -it`.
To destroy the Deployment (and its pods) you need to run `kubectl delete deployment <name>`.
@ -105,6 +107,9 @@ $ kubectl attach -it nginx-app-5jyvm
...
```
To detach from the container, you can type the escape sequence which is Ctrl+P
followed by Ctrl+Q.
#### docker exec
How do I execute a command in a container? Checkout [kubectl exec](/docs/user-guide/kubectl/{{page.version}}/#exec).