Skip to content

Instantly share code, notes, and snippets.

@mridang
Last active January 29, 2025 01:50
Show Gist options
  • Save mridang/c2dc7e313391395ed99049101c80d7e5 to your computer and use it in GitHub Desktop.
Save mridang/c2dc7e313391395ed99049101c80d7e5 to your computer and use it in GitHub Desktop.

Delete all CRDs in matching a name

kubectl get crd | grep 'cert-manager.io' | awk '{print $1}' | xargs kubectl delete crd

Find all pods with JSON logs

kubectl get pods --output=custom-columns=:metadata.name | xargs -I {} sh -c 'kubectl logs --all-containers=true {} | jq empty 2>/dev/null && echo "{} has JSON logs"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment