Prompt

How do I troubleshoot repeated container restarts in Kubernetes?

Technology / Observability1 observationLast seen Oct 19, 2026

Latest observation

Oct 19, 2026OpenAI APIWeb search: off

Repeated container restarts in Kubernetes usually mean the process in the container is crashing, failing liveness/readiness probes, being OOM-killed, or getting terminated by the platform. Here’s a practical troubleshooting flow.

1) Identify which pod and container are restarting

kubectl get pods -A
kubectl get pod <pod-name> -n <namespace> -o wide

Check restart count:

kubectl describe pod <pod-name> -n <namespace>

Look for:

  • Restart Count
  • Last State
  • Exit Code
  • Reason
  • probe failures
  • OOMKilled

2) Inspect logs from the current and previous container

Current logs:

kubectl logs <pod-name> -n <namespace> -c <container-name>

Previous crashed instance:

kubectl logs <pod-name> -n <namespace> -c <container-name> --previous

If the app starts and crashes quickly, --previous is often the most useful.

3) Check pod events

kubectl describe pod <pod-name> -n <namespace>

At the bottom, look at Events for clues such as:

  • Back-off restarting failed container
  • Liveness probe failed
  • Readiness probe failed
  • OOMKilled
  • image pull issues
  • mount/volume errors

4) Determine the exit reason

Common ones:

  • Exit Code 1: app error or misconfiguration
  • Exit Code 137: often OOMKilled or SIGKILL
  • Exit Code 143: SIGTERM, often graceful shutdown
  • OOMKilled: memory limit too low or memory leak
  • CrashLoopBackOff: container repeatedly exits and Kubernetes is backing off

You can inspect:

kubectl get pod <pod-name> -n <namespace> -o jsonpath='{.status.containerStatuses[*].lastState.terminated}'

5) Check liveness/readiness probes

Bad probe configuration is a very common cause of restarts.

Inspect deployment:

kubectl get deployment <deploy-name> -n <namespace> -o yaml

Look for:

  • livenessProbe
  • readinessProbe
  • startupProbe

Common issues:

  • probe hits the wrong path/port
  • app takes longer to start than probe timeout
  • probe depends on downstream services that aren’t ready
  • no startupProbe for slow-starting apps

If startup is slow, consider adding a startupProbe and relaxing liveness thresholds.

6) Check resource limits and node pressure

If the container is killed for memory:

kubectl describe pod <pod-name> -n <namespace>

Look for OOMKilled.

Review resource requests/limits:

kubectl get deployment <deploy-name> -n <namespace> -o yaml | grep -A5 -B5 resources

Check node status:

kubectl describe node <node-name>

Look for:

  • MemoryPressure
  • DiskPressure
  • PIDPressure
  • evictions

7) Verify configuration and secrets

Crash loops often come from missing or bad config.

Check:

  • environment variables
  • ConfigMaps
  • Secrets
  • file mounts
  • command/args overrides

Examples:

kubectl get configmap -n <namespace>
kubectl get secret -n <namespace>
kubectl describe pod <pod-name> -n <namespace>

A typo in an env var name or a bad secret value can cause startup failure.

8) Check for dependency failures

If the app depends on DBs, caches, or APIs, it may exit if they’re unavailable.

Look for logs indicating:

  • connection refused
  • authentication failure
  • DNS resolution failure
  • timeout

Test connectivity from inside the pod:

kubectl exec -it <pod-name> -n <namespace> -- sh

Then try:

  • nslookup <service>
  • curl <endpoint>
  • nc -vz <host> <port>

9) Compare with deployment history

See if a recent rollout introduced the issue:

kubectl rollout history deployment/<deploy-name> -n <namespace>
kubectl rollout status deployment/<deploy-name> -n <namespace>

You can roll back if needed:

kubectl rollout undo deployment/<deploy-name> -n <namespace>

10) If it only happens on certain nodes, inspect the node

Sometimes the pod is fine but a specific node has issues.

Check where the pod lands:

kubectl get pod <pod-name> -n <namespace> -o wide

Then inspect:

kubectl describe node <node-name>
kubectl get events -A --sort-by=.lastTimestamp

Look for:

  • node reboot or drain
  • kubelet errors
  • disk full
  • network issues

11) Use an ephemeral/debug container if the app won’t stay up

If the image includes shell tools or you can use a debug container:

kubectl debug -it pod/<pod-name> -n <namespace> --image=busybox --target=<container-name>

This helps inspect:

  • filesystem
  • config files
  • networking
  • DNS
  • process behavior

12) Common root causes checklist

  • Application exception on startup
  • Missing env var / secret / config file
  • Incorrect command or args
  • Bad probe configuration
  • Out of memory / memory leak
  • Dependency not ready
  • File permission or volume mount issue
  • Image mismatch or incompatible binary
  • Node resource pressure
  • Crash due to signal or fatal error

Quick triage commands

kubectl describe pod <pod> -n <ns>
kubectl logs <pod> -n <ns> --previous
kubectl get pod <pod> -n <ns> -o wide
kubectl get events -n <ns> --sort-by=.lastTimestamp
kubectl describe node <node>

If you want, I can also give you:

  1. a step-by-step decision tree for CrashLoopBackOff, or
  2. a scripted checklist you can run during incident response.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.