From aad35d1d4ee0b1c18f350f3b70126c92a90f7b00 Mon Sep 17 00:00:00 2001 From: Qiming Date: Fri, 26 Jan 2018 06:12:34 +0800 Subject: [PATCH] Add escape sequence for kubectl attach/run (#6740) --- docs/reference/kubectl/docker-cli-to-kubectl.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/reference/kubectl/docker-cli-to-kubectl.md b/docs/reference/kubectl/docker-cli-to-kubectl.md index cb521f620c..ce91046c2d 100644 --- a/docs/reference/kubectl/docker-cli-to-kubectl.md +++ b/docs/reference/kubectl/docker-cli-to-kubectl.md @@ -53,6 +53,8 @@ kubectl run [-i] [--tty] --attach --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 `. @@ -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).