con un clic
troubleshoot-pod
Troubleshoot a problematic pod in OpenShift. Use when a pod is CrashLooping, not ready, failing health checks, or showing errors. Walks through events, logs, describe, and common failure patterns.
Menú
Troubleshoot a problematic pod in OpenShift. Use when a pod is CrashLooping, not ready, failing health checks, or showing errors. Walks through events, logs, describe, and common failure patterns.
OpenShift Lightspeed CLI — AI-powered assistant for OpenShift from your terminal. Connects to OpenShift Lightspeed Service (OLS) REST API and provides interactive chat, streaming responses, cluster-aware tools, and session management. Use when working with OpenShift clusters, Kubernetes operations, or needing AI-powered cluster assistance from the command line.
Check the overall health of an OpenShift cluster. Use when the user asks about cluster status, node health, capacity, or wants a quick health overview.
Guide deploying an application to OpenShift. Use when the user wants to deploy a new app, create a deployment, set up services and routes. Covers S2I, Docker, Helm, and raw YAML approaches.
Run a security audit on an OpenShift namespace or cluster. Use when the user asks about security posture, RBAC, SCCs, network policies, or compliance.
| name | troubleshoot-pod |
| description | Troubleshoot a problematic pod in OpenShift. Use when a pod is CrashLooping, not ready, failing health checks, or showing errors. Walks through events, logs, describe, and common failure patterns. |
| metadata | {"author":"kcns008","version":"0.1.0"} |
Get pod status
oc_get: resource=pods -n <namespace>
Identify the problematic pod. Note its status (CrashLoopBackOff, ImagePullBackOff, Pending, etc.)
Describe the pod
oc_describe: resource=pod/<pod-name> -n <namespace>
Look for: Events (bottom), State, Last State, Reason, Message
Check events
bash: oc get events -n <namespace> --sort-by='.lastTimestamp' --field-selector involvedObject.name=<pod-name>
Fetch logs
oc_logs: pod=<pod-name> -n <namespace> --tail=100
If crashed previously, add --previous flag
Diagnose based on patterns
| Status | Common Cause | Fix |
|---|---|---|
| CrashLoopBackOff | App crash on startup | Check logs for exception/exit code |
| ImagePullBackOff | Wrong image/tag or no pull secret | Verify image name, check secrets |
| Pending | No resources (CPU/memory) or PVC issues | Check node capacity, PVC status |
| OOMKilled | Memory limit too low | Increase memory limit |
| Error | Config/secrets missing | Check env vars, mounted configmaps |
| Completed | Job/one-shot finished | Normal for Jobs |
Summarize findings and suggest fix