Skip to main content
In this lab you will learn how Kubernetes Deployments create ReplicaSets and Pods, how to inspect cluster objects, how to troubleshoot an image-pull failure, and how to create Deployments both from a manifest and with kubectl create. Prerequisites
  • A Kubernetes cluster (e.g., kind, Minikube, or a hosted cluster) and kubectl configured to talk to it.
  • Basic familiarity with kubectl commands.
Objectives
  • Confirm cluster initial state (no resources in default namespace).
  • Create a Deployment and observe the ReplicaSet and Pods it creates.
  • Troubleshoot an ImagePullBackOff caused by an invalid image name.
  • Fix a manifest and create a Deployment from a file.
  • Create a Deployment with kubectl create deployment.
Quick reference links Initial state — check how many Pods, ReplicaSets, and Deployments exist
  • Question: How many Pods exist on the system?
Run:
Expected output (empty cluster / default namespace):
  • Question: How many ReplicaSets exist?
Run:
Expected output:
  • Question: How many Deployments exist?
Run:
Expected output:
This confirms the environment is clean: no Pods, ReplicaSets, or Deployments in the default namespace. Create a Deployment (observe changes)
  • After creating a Deployment (the exercise creates a Deployment named frontend-deployment), re-check Deployments, ReplicaSets, and Pods.
Run:
Example output shortly after creation (deployment still coming up):
Check ReplicaSets:
Example output (Deployment created a ReplicaSet):
Check Pods:
Example output (pods exist but are not ready due to image pull problems):
  • Question: Out of the existing Pods, how many are ready?
Answer: 0 out of 4 pods are ready (see the READY column above). Troubleshoot one Pod to find the image used
  • Describe one of the Pods to see the container image and error reason:
Relevant excerpt from the describe output:
From this output we see the container image is busybox888. The container is in ErrImagePull / ImagePullBackOff because that image name does not exist (or cannot be pulled). That explains why none of the pods are ready.
When creating manifests, ensure kind values are correctly capitalized (for example, kind: Deployment). Also verify apiVersion is appropriate for the kind.
If you see ErrImagePull or ImagePullBackOff, confirm the image name and tag are correct and that the image is accessible from your cluster (e.g., public Docker Hub, private registry with proper credentials).
Fix the manifest and create the Deployment from a file
  • The provided manifest deployment-definition-1.yaml should use a correct apiVersion and a properly capitalized kind. A corrected example manifest (that uses the same busybox888 image as in the exercise) looks like:
After fixing the manifest, create the Deployment:
If kind and apiVersion are correct, the resource will be created successfully. Use kubectl get deploy and kubectl get pods to confirm status and troubleshoot further if pods are not ready. Create a new Deployment using kubectl create deployment
  • Next task: create a Deployment named httpd-frontend with 3 replicas using the httpd image. Use kubectl create deployment with --image and --replicas.
Run:
Expected confirmation:
Verify the Deployment and Pods reach the Ready state:
Example output shortly after creation (may initially show 0/3):
Wait a few seconds and check again; the httpd-frontend Deployment should become ready once pods pull the image successfully and pass readiness checks:
Example final state after pods become Ready:
This verifies the new httpd-frontend Deployment has 3 ready replicas. Commands summary Wrap-up
  • A Deployment creates a ReplicaSet which in turn manages Pods.
  • Use kubectl get and kubectl describe to inspect resource status and to identify ErrImagePull / ImagePullBackOff issues.
  • Manifest errors (for example, wrong case in kind) lead to API errors when creating resources—ensure apiVersion and kind are correct.
  • You practiced creating a Deployment from a manifest and with kubectl create deployment, and verified Pod readiness.
Further reading

Watch Video