Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dpandhi-git authored Jun 7, 2019
1 parent aa96765 commit 3506671
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions content/en/docs/reference/kubectl/cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ echo $(kubectl get pods --selector=$sel --output=jsonpath={.items..metadata.name
# Also uses "jq"
for item in $( kubectl get pod --output=name); do printf "Labels for %s\n" "$item" | grep --color -E '[^/]+$' && kubectl get "$item" --output=json | jq -r -S '.metadata.labels | to_entries | .[] | " \(.key)=\(.value)"' 2>/dev/null; printf "\n"; done

kubectl get pod --show-labels

# Check which nodes are ready
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}' \
&& kubectl get nodes -o jsonpath="$JSONPATH" | grep "Ready=True"
Expand Down

0 comments on commit 3506671

Please sign in to comment.