A Kubernetes namespace creates a virtual cluster inside a physical cluster. It scopes resource names and separates workloads so teams or applications can share infrastructure with fewer naming conflicts. Kubernetes uses the default namespace when no namespace is specified. section 3.3.5
Use namespaces to:
- Organize pods, services, ReplicaSets, and other resources by team or application. section 3.3.5
- Create a namespace with kubectl, then target it explicitly with commands such as kubectl get pod -n funny. section 3.3.5
- Place a workload or service in the namespace by adding namespace under metadata in its manifest. section 3.3.5
Deploying into a namespace
Create funny, deploy hello-joker there, and inspect its resources with kubectl. The deployment produces three running pods, while a ClusterIP service is listed with kubectl get services -n funny. Services can be addressed with the namespace-qualified form joker-cluster-ip-service.funny.svc.cluster.local. section 3.3.5
apiVersion: apps/v1
kind: Deployment
metadata:
name: joker-deployment
namespace: funny
labels:
app: fast-api
..
Inspect the manifest pattern that assigns a Deployment to a namespace through metadata.namespace. section 3.3.5




