Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
Last active April 17, 2024 02:50
Show Gist options
  • Save zulhfreelancer/a5adf80b0bd57768f85c8d5c93506991 to your computer and use it in GitHub Desktop.
Save zulhfreelancer/a5adf80b0bd57768f85c8d5c93506991 to your computer and use it in GitHub Desktop.
kubectl/jq - How to select/filter not `null` objects?
# List all deleted pods
kubectl get pods -o json | jq -r '.items[] | select(.metadata.deletionTimestamp != null)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment