RESOURCES

Top 15 Real-World Kubernetes Problems and How to Troubleshoot Them

Learn how to troubleshoot 15 common Kubernetes problems, including CrashLoopBackOff, ImagePullBackOff, Pending Pods, OOMKilled, networking failures, and deployment issues. Explore practical kubectl commands, root causes, and step-by-step solutions with real-world examples.

Resource Featured Kubernetes Updated:
Thumbnail for Top 15 Real-World Kubernetes Problems and How to Troubleshoot Them

Vyomanant Academy

Build these skills hands-on

Explore structured, practical technology programs from Vyomanant Academy.

Explore Courses
On this page

Imagine deploying an application to Kubernetes. Everything looks fine until you notice that your Pods are restarting, your application is unreachable, or your deployment is stuck.

How do you identify the problem and fix it?

Kubernetes troubleshooting becomes much easier when you understand common errors, their causes, and the commands used to investigate them.

In this guide, we'll explore 15 real-world Kubernetes problems, with simple explanations, practical commands, and solutions.

Before You Start: Essential Troubleshooting Commands

These commands are useful for investigating most Kubernetes issues.

# Check Pods across all namespaces
kubectl get pods -A

# Check detailed Pod information
kubectl describe pod <pod-name> -n <namespace>

# View application logs
kubectl logs <pod-name> -n <namespace>

# View logs from the previous container instance
kubectl logs <pod-name> --previous -n <namespace>

# Check recent namespace events
kubectl get events -n <namespace> --sort-by=.lastTimestamp

# Check deployment status
kubectl get deployments -n <namespace>

# Check node health
kubectl get nodes

Troubleshooting Tip: Start with kubectl get, then use kubectl describe to inspect events, and kubectl logs to investigate application failures.


1. CrashLoopBackOff — Container Keeps Restarting

Problem: A container starts, crashes, and Kubernetes repeatedly attempts to restart it with increasing delays.

Common Causes:

  • Application startup errors.
  • Missing environment variables.
  • Incorrect configuration.
  • Application dependency failures.

Troubleshooting Commands:

kubectl get pods

kubectl describe pod <pod-name>

kubectl logs <pod-name> --previous

Real-World Example:

A Java application crashes because the required database connection URL is missing.

Solution:

  1. Check previous container logs.
  2. Identify the missing configuration.
  3. Correct the environment variable or configuration.
  4. Redeploy the application.

Key Point: CrashLoopBackOff describes the restart behavior, not the actual root cause.


2. ImagePullBackOff — Kubernetes Cannot Pull the Image

Problem: Kubernetes cannot download the container image required to start a Pod.

Common Causes:

  • Incorrect image name or tag.
  • Private registry authentication failure.
  • Registry connectivity problems.
  • Image does not exist.

Troubleshooting:

kubectl describe pod <pod-name>

Check the Events section for image pull errors.

Real-World Example:

containers:
  - name: web
    image: myregistry/webapp:v99

The image tag v99 does not exist in the registry.

Solution:

Update the deployment to use an existing image tag.

kubectl set image deployment/webapp \
  web=myregistry/webapp:v2

Key Point: Verify the image name, tag, registry access, and image pull credentials.


3. Pending Pod — Pod Is Not Getting Scheduled

Problem: A Pod remains in the Pending state because Kubernetes cannot schedule it or complete its setup.

Common Causes:

  • Insufficient CPU or memory.
  • Node selector mismatch.
  • Node taints without matching tolerations.
  • PersistentVolumeClaim issues.

Troubleshooting:

kubectl describe pod <pod-name>

kubectl get nodes

kubectl get pvc

Real-World Example:

A Pod requests 8 CPU cores, but no eligible node has enough available capacity.

Solution:

  • Review resource requests.
  • Add suitable cluster capacity.
  • Check node selectors and taints.
  • Verify storage claims.

Key Point: The Pod Events section usually provides the most useful scheduling information.


4. OOMKilled — Container Runs Out of Memory

Problem: A container exceeds its memory limit and is terminated.

Common Causes:

  • Memory leaks.
  • Insufficient memory limits.
  • High application memory consumption.

Troubleshooting:

kubectl describe pod <pod-name>

kubectl top pod <pod-name>

Look for:

Reason: OOMKilled
Exit Code: 137

Exit code 137 can also occur for other SIGKILL events, so confirm the termination reason.

Real-World Example:

A Java application requires more memory than its configured container limit.

Solution:

  • Investigate application memory usage.
  • Fix memory leaks where applicable.
  • Adjust memory requests and limits based on actual requirements.

Key Point: Increasing memory limits may help, but understanding the application's memory usage is essential.


5. ErrImagePull — Initial Image Download Fails

Problem: Kubernetes encounters an error while attempting to pull a container image.

ErrImagePull commonly appears before repeated failures lead to ImagePullBackOff.

Troubleshooting:

kubectl describe pod <pod-name>

Real-World Example:

A private container registry rejects the image pull request because credentials are missing.

Solution:

Create an image pull secret using valid registry credentials.

kubectl create secret docker-registry regcred \
  --docker-server=<registry-server> \
  --docker-username=<username> \
  --docker-password=<password>

Reference it in the Pod specification:

imagePullSecrets:
  - name: regcred

Key Point: Use imagePullSecrets for private registry authentication. Avoid exposing credentials in shell history or source code.


6. CreateContainerConfigError — Invalid Container Configuration

Problem: Kubernetes cannot create a container because required configuration is missing or invalid.

Common Causes:

  • Missing ConfigMap.
  • Missing Secret.
  • Incorrect referenced key.

Troubleshooting:

kubectl describe pod <pod-name>

kubectl get configmaps

kubectl get secrets

Real-World Example:

A Pod references a Secret named db-credentials, but the Secret does not exist in its namespace.

Solution:

Create the required Secret or correct the reference.

kubectl create secret generic db-credentials \
  --from-literal=username=appuser \
  --from-literal=password=<password>

Key Point: ConfigMaps and Secrets referenced by a Pod generally need to exist in the same namespace.


7. Pod Stuck in Terminating State

Problem: A Pod remains in the Terminating state longer than expected.

Common Causes:

  • Application does not shut down properly.
  • Finalizers prevent deletion.
  • Node or kubelet communication problems.
  • Storage unmount delays.

Troubleshooting:

kubectl describe pod <pod-name>

kubectl get pod <pod-name> -o yaml

Check finalizers, node health, and termination events.

Real-World Example:

An application does not respond to its termination signal and remains stuck during shutdown.

Solution:

  • Investigate application shutdown behavior.
  • Review termination grace periods.
  • Check finalizers and storage operations.

Last Resort:

kubectl delete pod <pod-name> \
  --grace-period=0 --force

Warning: Force deletion removes the Pod object without confirming that the workload has stopped on the node. Use it only after understanding the risks.


8. Service Not Accessible — Application Cannot Be Reached

Problem: Pods are running, but users or other applications cannot access the service.

Common Causes:

  • Incorrect Service selector.
  • Incorrect target port.
  • Application not listening on the expected interface.
  • NetworkPolicy restrictions.

Troubleshooting:

kubectl get svc

kubectl describe svc <service-name>

kubectl get endpointslices \
  -l kubernetes.io/service-name=<service-name>

Real-World Example:

The Service selector is:

selector:
  app: frontend

But the Pods use:

labels:
  app: webapp

Solution:

Make sure the Service selector matches the Pod labels.

Key Point: A Service must select the correct, ready Pods and forward traffic to the correct application port.


9. DNS Resolution Failure — Services Cannot Find Each Other

Problem: Applications cannot resolve Kubernetes Service names.

Common Causes:

  • CoreDNS issues.
  • Incorrect Service name.
  • Incorrect namespace.
  • Network restrictions affecting DNS.

Troubleshooting:

kubectl get pods -n kube-system

kubectl get svc -n kube-system

Test DNS from a diagnostic Pod:

kubectl run dns-test --rm -it \
  --image=busybox:1.36 \
  --restart=Never -- nslookup kubernetes.default.svc.cluster.local

Real-World Example:

An application in the frontend namespace tries to connect to a Service named database in the backend namespace using only database.

Solution:

Use the fully qualified Service name:

database.backend.svc.cluster.local

Key Point: Kubernetes DNS supports namespace-aware Service discovery.


10. Readiness Probe Failed — Pod Cannot Receive Traffic

Problem: Kubernetes considers the container unready, so the Pod is not eligible for normal Service traffic.

Common Causes:

  • Incorrect probe path.
  • Application not ready.
  • Incorrect port.
  • Dependency unavailable.

Troubleshooting:

kubectl describe pod <pod-name>

kubectl logs <pod-name>

Real-World Example:

The application exposes /health, but the readiness probe checks /ready.

Solution:

Configure the correct endpoint.

readinessProbe:
  httpGet:
    path: /health
    port: 8080
  initialDelaySeconds: 5
  periodSeconds: 10

Key Point: A readiness probe determines whether a container is ready to receive traffic. A failed readiness probe does not automatically restart the container.


11. Liveness Probe Failed — Container Keeps Restarting

Problem: Kubernetes restarts a container after repeated liveness probe failures.

Common Causes:

  • Incorrect health endpoint.
  • Application becomes unresponsive.
  • Probe timeout is too short.
  • Slow startup without a suitable startup probe.

Troubleshooting:

kubectl describe pod <pod-name>

kubectl logs <pod-name> --previous

Real-World Example:

A Spring Boot application takes 60 seconds to start, but the liveness probe begins too early.

Solution:

Configure a startup probe to allow sufficient initialization time.

startupProbe:
  httpGet:
    path: /actuator/health
    port: 8080
  periodSeconds: 5
  failureThreshold: 15

Key Point: Startup probes protect slow-starting applications from premature liveness and readiness checks.


12. PersistentVolumeClaim Pending — Storage Is Not Available

Problem: A PersistentVolumeClaim (PVC) remains in the Pending state.

Common Causes:

  • No matching PersistentVolume.
  • Incorrect StorageClass.
  • Dynamic provisioning failure.
  • Unsupported access mode or capacity.

Troubleshooting:

kubectl get pvc

kubectl describe pvc <pvc-name>

kubectl get storageclass

kubectl get pv

Real-World Example:

A PVC requests a StorageClass that does not exist in the cluster.

Solution:

Use an available StorageClass or configure the required storage provisioner.

Key Point: PVC binding depends on storage availability, provisioning configuration, and matching requirements.


13. Node NotReady — Kubernetes Node Becomes Unhealthy

Problem: A worker node reports NotReady, affecting workload scheduling and availability.

Common Causes:

  • Kubelet failure.
  • Network connectivity issues.
  • Container runtime problems.
  • Resource or disk pressure.

Troubleshooting:

kubectl get nodes

kubectl describe node <node-name>

On a Linux node, if you have authorized access:

sudo systemctl status kubelet

Real-World Example:

A worker node runs out of disk space, causing kubelet and container operations to fail.

Solution:

  • Check node conditions.
  • Investigate disk usage and logs.
  • Resolve resource pressure.
  • Restore unhealthy node services.

Key Point: Check node conditions and events before restarting services.


14. Deployment Rollout Stuck — New Version Is Not Deploying

Problem: A deployment does not complete successfully.

Common Causes:

  • New Pods fail readiness checks.
  • Invalid image configuration.
  • Insufficient cluster resources.
  • Application startup errors.

Troubleshooting:

kubectl rollout status deployment/<deployment-name>

kubectl describe deployment <deployment-name>

kubectl get pods

Real-World Example:

A new application version contains an incorrect database configuration and cannot become ready.

Solution:

Investigate the new Pods and correct the configuration.

If necessary, roll back to the previous revision:

kubectl rollout undo deployment/<deployment-name>

Key Point: A rollback is useful when a recent deployment introduces a problem, but it does not fix underlying infrastructure issues.


15. Ingress Not Working — External Traffic Cannot Reach the Application

Problem: An application works inside the cluster but cannot be accessed through its external URL.

Common Causes:

  • Missing or unhealthy Ingress controller.
  • Incorrect hostname or path rules.
  • Incorrect backend Service.
  • DNS or TLS configuration issues.

Troubleshooting:

kubectl get ingress -A

kubectl describe ingress <ingress-name>

kubectl get svc

Also check the health and logs of the installed Ingress controller.

Real-World Example:

An Ingress routes traffic to Service port 8080, but the Service exposes port 80.

Solution:

Update the Ingress backend to reference the correct Service port.

Key Point: An Ingress resource requires a working controller, valid routing rules, and a reachable backend Service.


Kubernetes Troubleshooting Cheat Sheet

Problem First Command to Check
CrashLoopBackOff kubectl logs <pod> --previous
ImagePullBackOff kubectl describe pod <pod>
Pending Pod kubectl describe pod <pod>
OOMKilled kubectl describe pod <pod>
ErrImagePull kubectl describe pod <pod>
CreateContainerConfigError kubectl describe pod <pod>
Pod Terminating kubectl get pod <pod> -o yaml
Service Not Accessible kubectl describe svc <service>
DNS Failure kubectl get pods -n kube-system
Readiness Probe Failure kubectl describe pod <pod>
Liveness Probe Failure kubectl logs <pod> --previous
PVC Pending kubectl describe pvc <pvc>
Node NotReady kubectl describe node <node>
Rollout Stuck kubectl rollout status deployment/<name>
Ingress Failure kubectl describe ingress <ingress>

Replace placeholders with your actual resource names. Add -n <namespace> where required.

Best Practices for Kubernetes Troubleshooting

Follow a structured approach:

  1. Identify the Problem: Check Pods, Deployments, Services, and Nodes.
  2. Inspect Events: Use kubectl describe to identify warnings and failures.
  3. Analyze Logs: Review application and container logs.
  4. Verify Configuration: Check images, environment variables, resources, and networking.
  5. Apply a Fix: Make the smallest appropriate change.
  6. Validate: Confirm the application is healthy after the change.

Important: Avoid deleting or restarting resources without understanding the root cause, especially in production environments.

Final Thoughts

Kubernetes troubleshooting is about identifying the root cause, not simply restarting failed Pods.

Most common issues involve container configuration, resource availability, networking, storage, or application health.

By understanding these 15 scenarios and practicing the relevant kubectl commands, you can investigate Kubernetes problems more confidently.

Key Takeaway: Check status, inspect events, analyze logs, identify the root cause, and verify the fix.

CONTINUE EXPLORING