Skip to content

πŸŽ“ Mission Debrief: Namespace Confusion

What Happened

Your resources were deployed to the "default" namespace instead of "k8squest". Namespaces provide isolationβ€”resources in different namespaces can't easily find each other.

How Kubernetes Behaved

Namespaces are virtual clusters within a physical cluster:

  • Provide scope for names (can have "web" pod in multiple namespaces)
  • Enable resource quotas and limits per namespace
  • Provide access control boundaries (RBAC per namespace)
  • Services can communicate within namespace easily
  • Cross-namespace communication requires fully qualified DNS

The Correct Mental Model

Namespace isolation:

Cluster
β”œβ”€β”€ default namespace
β”‚   β”œβ”€β”€ pod: app-1
β”‚   └── service: api
β”œβ”€β”€ k8squest namespace
β”‚   β”œβ”€β”€ pod: client-app
β”‚   └── service: backend-service
└── production namespace
    β”œβ”€β”€ pod: payment-processor
    └── service: payment-api

DNS resolution: - Same namespace: service-name - Cross-namespace: service-name.namespace-name.svc.cluster.local

Commands You Mastered

# List all namespaces
kubectl get namespaces

# View resources in specific namespace
kubectl get all -n <namespace>

# View resources in all namespaces
kubectl get pods --all-namespaces
kubectl get pods -A

# Create namespace
kubectl create namespace <name>

# Set default namespace for context
kubectl config set-context --current --namespace=<namespace>

# Delete namespace (careful!)
kubectl delete namespace <namespace>

Congratulations! πŸŽ‰

You've completed World 1: Core Kubernetes Basics!

You've mastered: - βœ… CrashLoopBackOff debugging - βœ… ImagePullBackOff resolution - βœ… Resource scheduling (Pending pods) - βœ… Labels and selectors - βœ… Port configuration - βœ… Multi-container pods - βœ… Log-based debugging - βœ… Init containers - βœ… Namespace isolation

Total XP Earned: 1,450 XP

Next: World 2 - Deployments & Scaling awaits!