A Namespace is the object of logical environment division in the same cluster in Kubernetes. You can manage the division of multiple teams or projects using Namespaces. In a Namespace, the name of a Kubernetes object must be unique. You can use ResourceQuotas to allocate available resources and control the access to different Namespace networks.
How to Use
Use in the TKE console: You can add, delete, change, and query Namespaces in the TKE console. Setting Usage Quota of a Namespace Resource with a ResourceQuota
You can have multiple ResourceQuota resources under one Namespace, and each ResourceQuota can set usage constraints for each Namespace resource. You can set the following usage constraints for Namespace resources:
Compute resource quotas, such as CPU and memory.
Storage resource quotas, such as total storage of requests.
Kubernetes object count quotas, such as the number of Deployments.
apiVersion: v1
kind: ResourceQuota
metadata:
name: object-counts
namespace: default
spec:
hard:
configmaps: "10"
replicationcontrollers: "20"
secrets: "10"
services: "10"
services.loadbalancers: "2"
cpu: "1000"
memory: 200Gi
Setting Access Control for a Namespace Network Using a NetworkPolicy
NetworkPolicy is a resource provided by Kubernetes (K8s) to define a Pod-based network isolation policy. You can not only restrict Namespaces, but also control network access among Pods, i.e., controlling whether a group of Pods can communicate with another group or other network endpoints.
Was this page helpful?