Skip to content

Instantly share code, notes, and snippets.

@hhcordero
Created February 14, 2022 12:38
Show Gist options
  • Save hhcordero/793e52c2c175e9f33e3802066831ea7a to your computer and use it in GitHub Desktop.
Save hhcordero/793e52c2c175e9f33e3802066831ea7a to your computer and use it in GitHub Desktop.
kubectl get pod -l app=app -o json | \
jq -r '.items[] | \
select (.status.containerStatuses != null) | \
{container_status: .status.containerStatuses[], name: .metadata.name} | \
select (.container_status.restartCount > <X number of restart>) | \
.name'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment