From 26cbacc3d6d3eaa5e4c869d40753d3bf9c455fc2 Mon Sep 17 00:00:00 2001 From: chrislovecnm Date: Sat, 10 Sep 2016 14:31:35 -0600 Subject: [PATCH] fixing a couple of commands, and adding an echo --- docs/user-guide/kubectl-cheatsheet.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/user-guide/kubectl-cheatsheet.md b/docs/user-guide/kubectl-cheatsheet.md index c14e7c5c03..b2e1c51fa9 100644 --- a/docs/user-guide/kubectl-cheatsheet.md +++ b/docs/user-guide/kubectl-cheatsheet.md @@ -85,7 +85,7 @@ $ kubectl describe pods # Lists pods created by --output=json | jq -j '.spec.selector | to_entries | .[] | "\(.key)=\(.value),"') $ sel=${sel%?} # Remove trailing comma -$ pods=$(kubectl get pods --selector=$sel --output=jsonpath={.items..metadata.name})` +$ pods=$(kubectl get pods --selector=$sel --output=jsonpath={.items..metadata.name}) +$ echo $pods # Check which nodes are ready -$ kubectl get nodes -o jsonpath='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'| tr ';' "\n" | grep "Ready=True" +$ kubectl get nodes -o jsonpath='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'| tr ';' "\n" | grep "Ready=True" ``` ## Modifying and Deleting Resources @@ -122,6 +123,6 @@ $ kubectl run -i --tty busybox --image=busybox -- sh # Run pod as interacti $ kubectl attach -i # Attach to Running Container $ kubectl port-forward # Forward port of Pod to your local machine $ kubectl port-forward # Forward port to service -$ kubectl exec -- ls / # Run command in existing pod (1 container case) -$ kubectl exec -c -- ls / # Run command in existing pod (multi-container case) +$ kubectl exec -- ls / # Run command in existing pod (1 container case) +$ kubectl exec -c -- ls / # Run command in existing pod (multi-container case) ```