kubernetes namespace - ghdrako/doc_snipets GitHub Wiki
Kubernetes namespaces
Feature | Benefit |
---|---|
Role-based access control (RBAC) per namespace | Enhanced security |
Resource isolation, Fewer API operations per namespace in large clusters | Improved performance |
Resource quotas per namespace | Better capacity management |
Name scoping provided by namespace | Efficient organization |
Namespace important concepts:
- Resources inside namespaces are logically separated from each other but they can still communicate
- Namespaces dont provide true multi-tenancy the way other solutions do ( such as public cloud virtual infrastructure or Openstack Private Cloud )
- There is a single default Kubernetes namespace, but you can create as many namespaces as needed within a cluster
- Namespaces cannot be nested within each other.
kubectl get namespac
Automatically created namespaces is:
- default- used by user apps by default, until there are other custom namespaces
- kube-public- used by public Kubernetes resources, not recommended to be used by cluster users
- kube-system- used by Kubernetes control plane, and must not be used by cluster users
kubectl create namespace test
kubectl delete ns test
kubectl config set-context --current --namespace=<insert-namespace-name-here>