All practice done on Ubuntu (AWS EC2 VM) using kubeadm cluster setup.


Table of Contents

  1. How Resources Are Structured
  2. Namespace
  3. Pod
  4. Deployment
  5. ReplicaSet
  6. Labels & Selectors
  7. Key Commands Reference

1. How Resources Are Structured

Every resource in Kubernetes lives inside a namespace. The flow from image to user looks like this:

Docker Image → Pod → Deployment (manages replicas) → Service (exposes to user)

Each namespace is isolated. For example, nginx and mysql can each have their own namespace with their own pods, deployments, and services — no conflict even if names overlap.


2. Namespace

A namespace is a logical boundary inside your cluster. Resources in one namespace are separate from resources in another.

Create via command:

kubectl create namespace nginx