Skip to main content
In this lesson you’ll learn how Kubernetes Deployments work and how to use kubectl to inspect, create, and fix them. We cover:
  • Inspecting the initial cluster state
  • Creating Deployments (manifest and kubectl shortcut)
  • Diagnosing common pod failures like ErrImagePull / ImagePullBackOff
  • Best practices and quick reference commands

Initial cluster state — verify there are no resources

Start by confirming the default namespace is empty for Pods, ReplicaSets, and Deployments:
This ensures you’re working from a clean slate.

Create a Deployment (frontend-deployment) and inspect controller behavior

When you create a Deployment, the Deployment controller creates a ReplicaSet which in turn creates Pods. After creating frontend-deployment, inspect each resource:
  • Question: How many of the four pods are Ready?
    • Answer: 0/4 are Ready (each pod shows 0/1 in READY).
Inspect one of the pods to see the failure reason:
Explanation: The pods are failing because the container image busybox888 cannot be found or pulled, causing ErrImagePull and ImagePullBackOff. Fix the image name in the Deployment to a valid image (for example busybox).

Fixing a manifest and creating a Deployment from a file

Assume you have a manifest deployment-definition-1.yaml in /root:
Attempting to create the Deployment may fail if the manifest has a typo or wrong casing:
This error commonly occurs due to typos or incorrect casing in the manifest. Kubernetes resource Kind values are case-sensitive — they must match the API (for example, Deployment not deployment).
A corrected manifest might look like this:
After fixing the manifest (for example, by correcting kind casing), create it:
Note: This manifest still references busybox888, which will likely fail to pull. Expect ImagePullBackOff / ErrImagePull unless you use a valid image name.

Create a Deployment using kubectl create (name + image)

The shortcut kubectl create deployment simplifies Deployment creation. The --replicas flag may or may not be supported depending on your kubectl version. If it’s not supported, create then scale. The task: create a Deployment named httpd-frontend using the httpd image with 3 replicas. Recommended sequence (works in all kubectl versions):
Example (create then scale):
Verify the Deployment is ready:

Quick troubleshooting checklist

  • If pods show ErrImagePull or ImagePullBackOff, run:
    • kubectl describe pod <pod-name> to see the container image and error reason.
    • kubectl logs <pod-name> for container logs (if any).
  • Manifests are case-sensitive for kind and apiVersion.
  • Use kubectl create deployment + kubectl scale or apply a manifest to set replica counts.

Useful command reference

Summary

  • A Deployment manages ReplicaSets, which manage Pods.
  • Pods failing to start often indicate image pull problems — verify the image name and registry access.
  • Kubernetes manifests are case-sensitive; typos in kind or apiVersion produce creation errors.
  • Use kubectl create deployment for quick setups and kubectl scale or a manifest to set replica counts.

Watch Video