capabilities.work

Troubleshoot a Failing Pod

A 4-step recipe with Kubernetes. We can help you get access.

Recipe · 4 steps

Troubleshoot a Failing Pod

Locate a non-Running pod and gather its detail, logs, and related events.

  1. List pods in the namespace filtered to those not in the Running phase. When nothing matches, the namespace is healthy and the flow ends.
  2. Read the failing pod for its phase, node assignment, IPs, and conditions, which distinguish a scheduling failure from a container-level failure.
  3. Tail the container log for an application-level cause such as a crash on startup or a failed dependency check.
  4. List namespace events to surface the cluster-level cause the pod object alone does not carry, such as ImagePullBackOff or FailedScheduling.
What you'll need to have ready
  • namespace: The namespace to triage.
  • phaseSelector: Field selector isolating unhealthy pods (e.g. status.phase!=Running).
  • labelSelector: Optional label selector narrowing triage to one application.
  • container: Container to read logs from in a multi-container pod.
  • tailLines: Number of log lines to retrieve from the end of the log.
For your developer

Arazzo workflow kubernetes:troubleshoot-pod, 4 operations: listNamespacedPods → getNamespacedPod → readNamespacedPodLog → listNamespacedEvents. Specs on APIs.io.