Kubernetes Namespace Healthcheck SLI

Icon 1 4 Troubleshooting Commands

Icon 2 Contributed by stewartshea

Icon 2 Codecollection: rw-cli-codecollection


This SLI uses kubectl to score namespace health. Produces a value between 0 (completely failing thet test) and 1 (fully passing the test). Looks for container restarts, events, and pods not ready.

Tasks:
  • Get Error Event Count within ${EVENT_AGE} and calculate Score
  • Get Container Restarts and Score in Namespace `${NAMESPACE}`
  • Get NotReady Pods in `${NAMESPACE}`
  • Generate Namespace Score in `${NAMESPACE}`