Skip to content

Instantly share code, notes, and snippets.

@15below-adamhancock
Created January 13, 2020 15:26
Show Gist options
  • Save 15below-adamhancock/11850dd93c73dc92cb5a51076c09789a to your computer and use it in GitHub Desktop.
Save 15below-adamhancock/11850dd93c73dc92cb5a51076c09789a to your computer and use it in GitHub Desktop.
# Number of pods not in Running state
kubectl get pods --all-namespaces | sed 's/\s\s*/ /g' | awk '{if(NR>1)print}' | cut -d ' ' -f4 | grep -vx 'Running' | wc -l
# Number of Nodes not in Ready state.
kubectl get nodes | sed 's/\s\s*/ /g' | awk '{if(NR>1)print}' | cut -d ' ' -f2 | grep -xv 'Ready' | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment