1. StreamNative Platform
  2. Administer

Work with tenants

A tenant is an administrative unit for allocating capacity and enforcing an authentication or authorization scheme. After creating a cluster, you can create one or more tenants for the organization.

Work with tenants using pulsarctl CLI tool

You can create, update, and delete tenants using the pulsarctl CLI tool. For a full list of supported operations on tenants, see pulsarctl command reference.

Before using the pulsarctl CLI tool, you need to connect to a Pulsar cluster. For details, see connect to Pulsar cluster using pulsarctl CLI tool.

Create a tenant

After creating a Pulsar cluster, you can create tenants for the Pulsar cluster. When creating a tenant, you need to use -cluster or -c option to specify the target cluster for the tenant.

This example shows how to create a tenant named example-tenant for the example-cluster cluster with the admin role. If you do not configure the admin role when creating the tenant, you cannot perform follow-up operations on the target tenant, such as updating or deleting tenants.

Input

pulsarctl tenants create example-tenant -r [email protected] -c example-cluster

Output

Create tenant example-tenant successfully

Manage a tenant

This section describes how to manage tenants through the pulsarctl CLI tool.

Update a tenant

When you want to add more admin roles for a tenant, you can use the pulsarctl tenants update command to update the target tenant.

This example shows how to update the admin role for example-tenant.

Input

pulsarctl tenants update --admin-roles (bot) --admin-roles (bot1) example-tenant -c example-cluster

Output

Update tenant example-tenant successfully

Delete a tenant

When you want to remove a tenant from a Pulsar cluster, you can delete it. If a tenant is associated with any resources, you cannot delete the tenant. In this case, you must delete its associated resources first.

You cannot delete a tenant if there are resources associated with the tenant.

This example shows how to delete example-tenant.

Input

pulsarctl tenants delete example-tenant

Output

Delete tenant example-tenant successfully

Work with tenants using StreamNative Console

This section describes how to work with tenants using the StreamNative Console.

Create a tenant

To create a tenant, follow these steps.

  1. On the left navigation pane, under TENANT/NAMESPACE, select the current default tenant/namespace, and then click NEW TENANT.

  2. On the Tenants page, click New Tenant.

  3. Configure the tenant, as outlined in the following table.

    FieldDescrption
    TenantEnter a name for the tenant. A tenant name can contain any combination of lowercase letters (a-z), numbers (0-9), and hyphens (-).
    Allowed ClustersSelect an allowed cluster for the tenant.
    Admin Role(Optional) Select one or more Admin roles for the tenant.
  4. Click Confirm.

Manage a tenant

This section describes how to manage a tenant through the StreamNative Console.

Edit a tenant

To edit a tenant, follow these steps.

  1. On the left navigation pane, in the Admin section, click Tenants/Namespaces.

  2. Select one or more Admin roles for the tenant from the drop-down list.

  3. To add more namespaces for the tenant, click the link on the tenant name and then click New Namespace. For details about how to create a namespace, see create a namespace.

Delete a tenant

You cannot delete a tenant if there are resources associated with the tenant.

To delete a tenant, follow these steps.

  1. On the left navigation pane, in the Admin section, click Tenants/Namespaces.

  2. Click Delete in the Actions column. A dialog box displays asking, Are you sure you want to delete this?

  3. Enter the tenant name and then click Confirm.

Next step

Previous
Work with users