From a0600caf94169af0769036388ab0f33beac3e341 Mon Sep 17 00:00:00 2001 From: Janet Kuo Date: Tue, 29 Mar 2016 16:27:59 -0700 Subject: [PATCH] Update interactive pods section --- docs/user-guide/debugging-services.md | 34 ++++++++++----------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/docs/user-guide/debugging-services.md b/docs/user-guide/debugging-services.md index 9bbc5ca768..b4f68e7e0c 100644 --- a/docs/user-guide/debugging-services.md +++ b/docs/user-guide/debugging-services.md @@ -40,38 +40,27 @@ OUTPUT ## Running commands in a Pod For many steps here you will want to see what a `Pod` running in the cluster -sees. Kubernetes does not directly support interactive `Pod`s (yet), but you can -approximate it: +sees. You can start a busybox `Pod` and run commands in it: ```shell -$ cat < +$ kubectl exec -c -- ``` -or +or run an interactive shell with: ```shell -$ kubectl exec -ti busybox-sleep sh +$ kubectl exec -ti -c sh / # ``` @@ -89,6 +78,7 @@ $ kubectl run hostnames --image=gcr.io/google_containers/serve_hostname \ deployment "hostnames" created ``` +`kubectl` commands will print the type and name of the resource created or mutated, which can then be used in subsequent commands. Note that this is the same as if you had started the `Deployment` with the following YAML: