SAE namespaces map to the Namespace resource type in Kubernetes. Use the saectl tool to create, list, view, and delete namespaces. Updating an existing namespace is not supported.
Prerequisites
Before you begin, ensure that you have:
The saectl tool installed and configured with an AccessKey ID, an AccessKey secret, and a deployment region. See Install and configure the saectl tool.
Create a namespace
Create a file named
namespace.yamlwith the following content:apiVersion: v1 kind: Namespace metadata: annotations: sae.aliyun.com/vpc-id: vpc-xxxxxxxxxxxxxxxxxxxx # VPC ID name: demo # Namespace ID spec: {}For a description of each field, see YAML configuration reference.
In the directory where
namespace.yamlis located, run:saectl apply -f namespace.yaml
List namespaces
saectl get nsThe output lists all namespaces in the configured region:
NAME STATUS REGION
default Active cn-hangzhou
demo Active cn-hangzhou| Field | Description |
|---|---|
NAME | The namespace ID. default indicates the default namespace. |
STATUS | The namespace status. Active means the namespace is ready to use. |
REGION | The region where the namespace resides. |
View namespace details
Use get for a compact YAML or JSON summary, or describe for the full human-readable output.
Get a namespace summary:
saectl get ns <namespace-id> -o yamlReplace <namespace-id> with the namespace ID. Use -o json to get JSON output instead.
Describe a namespace:
saectl describe ns <namespace-id>The describe output includes the full configuration of the namespace, including its annotations and status. This is useful when you need to confirm the VPC association or check the current status.
Delete a namespace
saectl delete ns <namespace-id>Replace <namespace-id> with the namespace ID.
YAML configuration reference
The following table describes the YAML fields for SAE namespaces.
| Field | Description | Required on create |
|---|---|---|
metadata.name | The namespace ID. | Yes |
metadata.annotations: sae.aliyun.com/vpc-id | The ID of the VPC to associate with the namespace. | Yes |
metadata.annotations: sae.aliyun.com/region | The region where the namespace resides. | Not supported — read-only. |
status.phase | The namespace status. | Not supported — read-only. |