Updated on 2024-10-15 GMT+08:00

Namespace Management

Namespaces isolate configurations in different environments. For example, resources (such as configurations and services) in the development and test environments are isolated from those in the production environment. Different namespaces can have the same group or data ID.

Precautions

  • The namespace ID is entered in the SDK connected to a Nacos engine. The namespace name is only the identifier used for viewing on the console.
  • If your service SDK uses a namespace ID that is not created on the Nacos server for service registration and discovery, the service can be registered and discovered, but cannot be viewed on the service management page of the registry/configuration center. You need to create the corresponding namespace before viewing the service. For details, see Creating a Namespace.

Prerequisites

You have created a Nacos engine instance. For details, see Creating a Registry/Configuration Center.

Creating a Namespace

When an instance is created, a default namespace public (reserved space) is automatically generated. This namespace cannot be edited or deleted. You can use this namespace to isolate resources and services. Up to 50 namespaces can be created.

  1. Log in to CSE.
  2. In the left navigation pane, choose Registry/Configuration Center.
  3. Click the target Nacos instance.
  4. Choose Namespaces and click Create Namespace.
  5. In the displayed dialog box, set the parameters as follows. Configuration items marked with an asterisk (*) are mandatory.

    Table 1 Namespace parameters

    Parameter

    Description

    *Namespace

    The namespace name can be customized and can contain a maximum of 128 characters except @ # $% ^ & *.

    Namespace ID

    Enter a maximum of 128 characters. Use only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). The namespace ID must be unique.

    NOTE:

    If no ID is entered during creation, the system randomly generates an ID.

  6. Click OK.

Editing a Namespace

  1. Log in to CSE.
  2. In the left navigation pane, choose Registry/Configuration Center.
  3. Click the target Nacos instance.
  4. Choose Namespaces.
  5. Click Edit in the Operation column of the namespace to be edited to edit the namespace name.

    The automatically generated namespace public cannot be edited.

  6. Click OK.

Deleting a Namespace

  1. Log in to CSE.
  2. In the left navigation pane, choose Registry/Configuration Center.
  3. Click the target Nacos instance.
  4. Choose Namespaces.
  5. Click Delete in the Operation column of the namespace to be deleted.
  6. In the displayed dialog box, click OK.