Skip to content

Document --show-labels #14778

@dpandhi-git

Description

@dpandhi-git

What would you like to be added
Add --show-labels options as part of kubectl cheatsheet
Currently documentation has length way to find it out
# Show labels for all pods (or any other Kubernetes object that supports labelling) is # 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

Why is this needed
Quick reference to get to the Kubernetes object labels

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.language/enIssues or PRs related to English languagelifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.priority/backlogHigher priority than priority/awaiting-more-evidence.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions