Thuta Learning
ExercisesDevOpsintermediate

Hands-On Practice Set 1

Relax. We'll talk through this in plain words — no textbook voice.

What you'll walk away with

  • Understand Hands-On Practice Set 1 without any of the intimidation
  • Get comfortable running the kubectl commands/YAML yourself
  • Apply this concept right away in a real project

Let's think about it this way for a moment

This round is about putting the Basic/Intermediate concepts you've already learned into practice — there's nothing new to teach here. It's all hands-on: telling Pod, Deployment, and Service apart, spotting errors in YAML, and writing correct kubectl commands. Each task shouldn't take more than 5 minutes.

Let's connect this to a real scenario

Task 1: Explain, in one sentence each, what Pod, Deployment, and Service are each responsible for. Task 2: If a Deployment YAML has `selector.matchLabels: app: web` but `template.metadata.labels` is mistakenly set to `app: website`, predict and write down what error you'd get. Task 3: Write down when you'd use each of the three Service types (ClusterIP, NodePort, LoadBalancer), with examples. Task 4: If running `kubectl get pods` shows a pod stuck in 'Pending' status, write down two commands you'd use to debug it.

Let's look at it together

text
# Task 2 - label mismatch
selector.matchLabels: { app: web }
template.metadata.labels: { app: website }   # MISMATCH!

Result: Deployment creates pods with label "app: website",
but its own selector looks for "app: web" — it will never
see its own pods as "managed", and may create pods endlessly
or error depending on the Kubernetes version.

# Task 4 - debug a Pending pod
kubectl describe pod <pod-name>   # check Events for the reason
kubectl get nodes                  # check if any node has capacity
You should see
You'll come away knowing the differences between Pod/Deployment/Service, how to track down a label-mismatch bug, and the commands for debugging a Pending pod.

5-minute try-it

Write your own Deployment YAML and deliberately introduce a label-mismatch bug — after running `kubectl apply`, see for yourself what happens.

A quick word of caution

You don't need to set up a new cluster for this round — the focus is purely on practicing the concepts and debugging logic.

Easy traps

  • Getting Pod/Deployment/Service confused as if they were 'all basically the same thing'
  • Just reading the YAML error off the terminal output instead of using `kubectl describe`/`kubectl get events`

Now try it yourself

Write your own Deployment YAML and deliberately introduce a label-mismatch bug — after running `kubectl apply`, see for yourself what happens.

You'll know it worked when: You'll come away knowing the differences between Pod/Deployment/Service, how to track down a label-mismatch bug, and the commands for debugging a Pending pod.

Hands-On Practice Set 1 | Thuta Learning