liveBook · Manning

Kubernetes namespace

As explained in Road to Kubernetes

A Kubernetes Namespace is a resource that logically partitions, isolates, and groups other Kubernetes resources within a cluster.

A Kubernetes Namespace logically organizes resources inside a cluster. Assigning a Namespace to a Pod, Deployment, Service, or other resource lets you group and filter resources by project, team, or environment. section 8.1.3 section 8.4.4

Namespaces are useful for:

  • Keeping separate projects or internal teams organized. section 8.1.3
  • Separating application environments such as production, preproduction, development, and research. section 8.1.3
  • Filtering resources with kubectl, including by using the -n flag. section 8.4.4

Isolating a Redis deployment

Create a Namespace manifest, then apply it before creating the Redis resources: apiVersion: v1 kind: Namespace metadata: name: rk8s-redis Run kubectl apply -f redis-db/1-namespace.yaml. A StatefulSet and ClusterIP Service can declare namespace: rk8s-redis. Compare resources with kubectl get pods -n rk8s-redis and kubectl get pods -n default: the commands show resources from different Namespaces. section 8.4.4

How Road to Kubernetes covers it

How deep it goes
Defines grouping, default behavior, manifest declaration, and kubectl filtering, without developing deeper isolation mechanics.
Examples
Uses a Redis Namespace manifest alongside a Redis StatefulSet, ClusterIP Service, and kubectl resource comparisons.
What you can do after
Operate/configure Namespaces with kubectl and assign them to Kubernetes resource manifests.
How it connects
Connects Pods, Deployments, Services, StatefulSets, selectors, and Kubernetes DNS.

Also explained in

Compare how 5 books explain Kubernetes namespace →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Road to Kubernetes. The section links point to the parts of the book it draws on.