Configure Workspaces in Kong Manager

Workspaces enable an organization to segment traffic so that teams of admins sharing the same Kong cluster are only able to interact with entities from their groups. Within a workspace, it is possible to invite admins to a particular team and to enforce RBAC with roles and permissions that further delimit the types of actions and entities available to an admin.

Prerequisites

  • Authentication and RBAC are enabled
  • You are logged into Kong Manager as a super admin or a user that has /admins and /rbac read and write access

Default workspace

When the first Super Admin logs in, they begin in the workspace named default. From here, they may invite admins to manage the default or any other workspaces.

Navigating across workspaces in Kong Manager

To navigate between workspaces from the Overview page, click on any workspace displayed beneath the Vitals chart.

The list of workspaces may be rendered as cards or a table, depending on preference.

Create a Workspace

This guide describes how to create workspaces in Kong Manager. You can also use the Admin API /workspaces/ route to create a workspace.

  1. Log in as the Super Admin. On the Workspaces page, click the New Workspace button to see the Create Workspace form. Name and choose a color / icon for the new Workspace.

    Each workspace name should be unique, regardless of letter case. For example, naming one workspace “Payments” and another one “payments” will create two different workspaces that appear identical.

    Do not name workspaces the same as these major API names (paths) in Admin API:

    1. Admins
    2. Certificates
    3. Consumers
    4. Plugins
    5. Portal
    6. Routes
    7. Services
    8. SNIs
    9. Upstreams
    10. Vitals
  2. Click the Create New Workspace button. Upon creation, the application will navigate to the new Workspace’s dashboard.

Edit a workspace

  1. In the workspace you want to edit, navigate to the Dashboard page.

  2. Click the Settings button. This button takes you to the Edit Workspace page.

  3. Here, you can edit the workspace avatar and avatar background color.

  4. Click Update Workspace to save.

Delete a workspace

Wipe workspace data

To delete a workspace, all data must first be deleted from the workspace. Choose one of the following methods.

Kong Manager

Admin API

Portal CLI

Using Kong Manager, complete the following:

  1. Manually delete all files via Dev Portal > Editor. You cannot delete folders at this time, but deleting all files from a folder will remove the folder.
  2. Turn off the Dev Portal. Go to Dev Portal Settings > Advanced > Turn Off.
  3. Remove all roles from the workspace:

    1. Go to the Teams tab.
    2. Navigate to the Roles tab.
    3. Click View on the workspace you want to delete.
    4. Go to each role entry and click Edit.
    5. In the entry detail page, click Delete Role. A confirmation modal will appear. Click Delete Role again.
  4. Delete all Dev Portal files associated with the workspace:

    1. curl -i -X DELETE http://localhost:8001/{WORKSPACE_NAME}/files
  5. Turn off the Dev Portal for the workspace:

    1. curl -X PATCH http://localhost:8001/workspaces/{WORKSPACE_NAME} \
    2. --data "config.portal=false"
  6. Delete each role from the workspace:

    1. curl -i -X DELETE http://localhost:8001/{WORKSPACE_NAME}/rbac/roles/{ROLE_NAME|ROLE_ID}
  7. Delete all Dev Portal files associated with the workspace:

    1. portal wipe WORKSPACE_NAME
  8. Turn off the Dev Portal for the workspace:

    1. portal disable WORKSPACE_NAME
  9. Delete each role from the workspace. You can’t complete this step using the Portal CLI, so switch to either the Kong Manager or Admin API tab and complete step 3.

Delete a clean workspace

If your workspace is clean, you can delete it using the Kong Manager GUI or the Kong Admin API. If not, see the previous section to wipe workspace data.

Kong Manager

Admin API

  1. In the workspace you want to delete, navigate to the Dashboard page.

  2. Click the Settings button to open the Edit Workspace page.

  3. Click Delete.

    The deletion will fail if you have any data in your workspace.

Send a DELETE request to the Kong Admin API:

  1. curl -i -X DELETE http://localhost/workspaces/{WORKSPACE_NAME|WORKSPACE_ID}

The deletion will fail if you have any data in your workspace.

If it is successful, you should see the following response:

  1. HTTP 204 No Content

Workspace Access

If a role does not have permission to access entire endpoints within a workspace, the admin assigned to that role will not be able to see the related navigation links.

To set up access:

  1. Open Kong Manager.
  2. Click the Admins link in the Security section.

If the sidebar is collapsed, hover over the security badge icon and click Admins.

The Admins page displays a list of current admins and roles. Four default roles specific to the new workspace are already visible, and new roles specific to the workspace can be assigned from this page.

For more information about admins and roles, see RBAC in Kong Manager.