A namespace is a collection of resources and objects. Multiple namespaces can be created inside a cluster and isolated from each other. This enables namespaces to share the same cluster Services without affecting each other.
For example, you can deploy workloads in a development environment into one namespace, and deploy workloads in a testing environment into another namespace.
At least one cluster has been created.
A maximum of 6000 Services can be created in each namespace. The Services mentioned here indicate the Kubernetes Service resources added for workloads.
Namespaces can be categorized based on how they are created.
Parameter | Description |
|---|---|
Name | Unique name of the created namespace. |
Description | Description about the namespace. |
Quota Management | Resource quotas can limit the number of resources available in namespaces, achieving resource allocation by namespace. NOTICE: Configure resource quotas for each namespace to prevent overloading the cluster or nodes with excessive resources. For example, if your cluster resources are limited but you need to use multiple namespaces to isolate resources of different services, you can configure resource quotas for each namespace to maintain cluster stability and proper resource allocation. Enter a value. If a resource quota is not specified, there will be no limit imposed on the resources. If you want to limit the CPU or memory quota, you must specify the CPU or memory request value when creating a workload. |
apiVersion: v1kind: Namespacemetadata:name: custom-namespace
kubectl apply -f custom-namespace.yaml
Command output:
namespace/custom-namespace created
kubectl create namespace custom-namespace
kubectl get namespaces
The custom-namespace namespace is displayed in the list.
For more details about how to configure a namespace, see Manage Memory, CPU, and API Resources.