DevOps Bootcamp · Lesson

Inspecting and Troubleshooting Your Cluster

Use kubectl to inspect node and pod health, read logs, describe events, and exec into containers so you can diagnose problems in your first cluster.

Lesson 4 of 413 steps

Inspecting and Troubleshooting Your Cluster is a free DevOps Bootcamp lesson on CoddyKit. This is lesson 4 of 4. Any 3 lessons of this learning path are free to read in full — after that, CoddyKit PRO unlocks every lesson, plus hands-on practice with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, and your progress syncs across the web and the CoddyKit app. The DevOps Bootcamp course includes 4 lessons in total.

When Things Go Wrong

Your first deploy will sometimes misbehave. The good news: kubectl gives you everything needed to see what is happening and fix it methodically.

Check the Nodes

Start broad. Are the cluster nodes healthy and Ready?

kubectl get nodes -o wide

List Pods and Status

Look at pod phases. Running is good; Pending, CrashLoopBackOff, or ImagePullBackOff point to specific problems.

kubectl get pods -o wide

Describe for Details

kubectl describe is your best friend - it shows the spec, current state, and an Events list explaining scheduling and pull failures.

kubectl describe pod my-app-abc123

Read the Logs

Application errors usually surface in logs. Stream them with -f, or read a crashed container previous logs with --previous.

kubectl logs -f my-app-abc123

Logs from a Crash

If a pod keeps restarting, the current container has no useful logs yet. View the prior instance instead.

kubectl logs my-app-abc123 --previous

Exec Into a Container

Open a shell inside a running container to inspect files, env vars, and connectivity from the inside.

kubectl exec -it my-app-abc123 -- sh

Cluster-Wide Events

See recent events across the namespace, sorted by time, to spot patterns the per-pod view misses.

kubectl get events --sort-by=.lastTimestamp

Common Failure: ImagePullBackOff

This means Kubernetes cannot pull the image - wrong name/tag, private registry without credentials, or a typo. describe shows the exact pull error.

Common Failure: CrashLoopBackOff

The container starts then exits repeatedly. Check logs --previous for the crash reason - often a bad command, missing config, or failed dependency.

Resource and Connectivity Checks

Use kubectl top for live CPU/memory (needs metrics-server) and port-forward to test a service directly from your machine.

kubectl port-forward pod/my-app-abc123 8080:80

Quick Check

Diagnose a restarting pod.

Recap

You now have a troubleshooting toolkit:

  • get nodes/pods for health, describe for events
  • logs (and --previous) for app errors
  • exec to inspect from inside, port-forward to test
  • Recognize ImagePullBackOff and CrashLoopBackOff

A calm, systematic check of these usually finds the problem fast.

Free to start

Learn DevOps Bootcamp with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
142
Lessons
568

Frequently Asked Questions

Is the “Inspecting and Troubleshooting Your Cluster” lesson free?

Yes — any 3 lessons of the DevOps Bootcamp learning path, including “Inspecting and Troubleshooting Your Cluster”, are free to read in full here on the web. After that, CoddyKit PRO unlocks every lesson, plus interactive practice with a built-in code editor and a 24/7 AI tutor. The DevOps Bootcamp course includes 4 lessons in total.

What will I learn in “Inspecting and Troubleshooting Your Cluster”?

Use kubectl to inspect node and pod health, read logs, describe events, and exec into containers so you can diagnose problems in your first cluster. You practise DevOps Bootcamp with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start DevOps Bootcamp?

No prior experience is required. DevOps Bootcamp on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 4 of 4.

How long does the “Inspecting and Troubleshooting Your Cluster” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this DevOps Bootcamp lesson?

Yes. Every DevOps Bootcamp lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Minikube Installation & Setup
  2. Kubeconfig and Contexts
  3. Deploying a Simple App
  4. Inspecting and Troubleshooting Your Cluster
← Back to DevOps Bootcamp