- Function Overview
- Product Bulletin
- Service Overview
- Billing
- Getting Started
-
User Guide
- Clusters
- Workloads
- Network
- Storage
- O&M
- Namespaces
- ConfigMaps and Secrets
- Auto Scaling
- Add-ons
- Helm Chart
- Permissions
- Settings
- Best Practices
-
API Reference
- Before You Start
- API Overview
- Calling APIs
-
APIs
- Autopilot Cluster Management
- Add-on Management for Autopilot Clusters
-
Autopilot Cluster Upgrade
- Upgrading a Cluster
- Obtaining Cluster Upgrade Task Details
- Retrying a Cluster Upgrade Task
- Obtaining a List of Cluster Upgrade Task Details
- Performing a Pre-upgrade Check for a Cluster
- Obtaining Details About a Pre-upgrade Check Task of a Cluster
- Obtaining a List of Pre-upgrade Check Tasks of a Cluster
- Performing a Post-upgrade Check for a Cluster
- Backing Up a Cluster
- Obtaining a List of Cluster Backup Task Details
- Obtaining the Cluster Upgrade Information
- Obtaining a Cluster Upgrade Path
- Obtaining the Configuration of Cluster Upgrade Feature Gates
- Enabling the Cluster Upgrade Process Booting Task
- Obtaining a List of Upgrade Workflows
- Obtaining Details About a Specified Cluster Upgrade Booting Task
- Updating the Status of a Specified Cluster Upgrade Booting Task
- Quota Management for Autopilot Clusters
- Tag Management for Autopilot Clusters
-
Chart Management for Autopilot Clusters
- Uploading a Chart
- Obtaining a Chart List
- Obtaining a Release List
- Creating a Release
- Updating a Chart
- Deleting a Chart
- Updating a Release
- Obtaining a Chart
- Deleting a Release
- Obtaining a Release
- Downloading a Chart
- Obtaining Chart Values
- Obtaining Historical Records of a Release
- Obtaining the Quota of a User Chart
- Kubernetes APIs
- Permissions and Supported Actions
- Appendix
-
FAQs
- Billing
- Workloads
- Network Management
-
Storage
- Can PVs of the EVS Type in a CCE Autopilot Cluster Be Restored After They Are Deleted or Expire?
- What Can I Do If a Storage Volume Fails to Be Created?
- Can CCE Autopilot PVCs Detect Underlying Storage Faults?
- How Can I Delete the Underlying Storage If It Remains After a Dynamically Created PVC is Deleted?
- Permissions
- General Reference
Copied.
Creating a Namespace
When to Use Namespaces
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.
Prerequisites
At least one cluster has been created.
Constraints
A maximum of 6,000 Services can be created in each namespace. The Services mentioned here indicate the Kubernetes Service resources added for workloads.
Namespace Types
Namespaces can be created in either of the following ways:
- Created automatically: When a cluster is up, the default, kube-public, kube-system, and kube-node-lease namespaces are created by default.
- default: All objects for which no namespace is specified are allocated to this namespace.
- kube-public: Resources in this namespace can be accessed by all users (including unauthenticated users), such as public add-ons and container charts.
- kube-system: All resources created by Kubernetes are in this namespace.
- kube-node-lease: Each node has an associated Lease object in this namespace. The object is periodically updated by the node. Both NodeStatus and NodeLease are considered as heartbeats from a node. In versions earlier than v1.13, only NodeStatus is available. The NodeLease feature is introduced in v1.13. NodeLease is more lightweight than NodeStatus. This feature significantly improves the cluster scalability and performance.
- Created manually: You can create namespaces to serve separate purposes. For example, you can create three namespaces, one for a development environment, one for joint debugging environment, and one for test environment. You can also create one namespace for login services and one for game services.
Creating a Namespace
- Log in to the CCE console and click the cluster name to access the cluster console.
- In the navigation pane on the left, choose Namespaces. Then click Create Namespace in the upper right corner.
- Configure the parameters based on Table 1.
Table 1 Parameters for creating a namespace 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, for resource allocation by namespace.
NOTICE:You are advised to set resource quotas in the namespace as required to prevent cluster or node exceptions caused by resource overload.
Enter an integer. If the quota of a resource is not specified, no limit is posed on the resource.
If you want to limit the CPU or memory quota, you must specify the CPU or memory request value when creating a workload.
- Click OK.
Using kubectl to Create a Namespace
Define a namespace.
apiVersion: v1 kind: Namespace metadata: name: custom-namespace
Run the kubectl command to create it.
$ kubectl create -f custom-namespace.yaml namespace/custom-namespace created
You can also run the kubectl create namespace command to create a namespace.
$ kubectl create namespace custom-namespace namespace/custom-namespace created
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot