Skip to content

Organizing namespaces

Every namespace must be named <tenant>-<name>, using your lowercased tenant name; Capsule rejects anything else at admission (see Tenancy model). Names are lowercase with hyphens, at most 63 characters including the prefix. For example:

<tenant>-prod
<tenant>-staging
<tenant>-experiments
<tenant>-batch

One namespace suits most small workloads. Split when you want:

  • Network policy scope: NetworkPolicies apply per namespace. See Network policies.
  • Separate lifecycles: deleting a namespace removes everything in it, so keep throwaway work apart from production.
  • Tidier listings: kubectl get pods shows one project or stage at a time.

Splitting does not separate:

  • Access: every tenant member is admin in every tenant namespace.
  • Quota: all namespaces share the tenant’s ceiling. See Quotas.

If you need separate access or separate quota, you need a separate tenant (Cloud RAP).

Terminal window
kubectl create namespace <tenant>-experiments

Applying a Namespace manifest with kubectl apply works too. There is no limit on the number of namespaces.

ArgoCD can create namespaces too, from CreateNamespace=true or a Namespace manifest, and they join your tenant the same way. A Namespace manifest makes the namespace part of the Application, so deleting the Application with its resources deletes the namespace and everything in it.

Capsule adds capsule.clastix.io/tenant: <tenant> to every tenant namespace. Don’t remove or change it. You can add your own labels and annotations:

apiVersion: v1
kind: Namespace
metadata:
name: <tenant>-prod
labels:
environment: production
team: ml-pipeline
annotations:
description: "Production workloads for the ML pipeline"

Any tenant member can delete a namespace in the tenant:

Terminal window
kubectl delete namespace <tenant>-experiments

Deleting the tenant itself is an RCS operation; Capsule’s preventDeletion blocks it.