Configuring a user namespace name for automatic provisioning

You can configure the namespace name template that Che uses to create the required namespace when starting a workspace.

A valid namespace name template follows these conventions:

  • The <username> or <userid> placeholder is mandatory.

  • Usernames and IDs cannot contain invalid characters. If the formatting of a username or ID is incompatible with the naming conventions for Kubernetes objects, Che changes the username or ID to a valid name by replacing incompatible characters with the - symbol.

  • Che evaluates the <userid> placeholder into a 14 character long string, and adds a random six character long suffix to prevent IDs from colliding. The result is stored in the user preferences for reuse.

  • Kubernetes limits the length of a namespace name to 63 characters.

  • OpenShift limits the length further to 49 characters.

Procedure
  • Configure the CheCluster Custom Resource. See Using the CLI to configure the CheCluster Custom Resource.

    spec:
      components:
        devEnvironments:
          defaultNamespace:
            template: <workspace_namespace_template_>
    Example 1. User workspaces namespace name template examples
    User workspaces namespace name template Resulting namespace example

    <username>-che (default)

    user1-che

    <userid>-namespace

    cge1egvsb2nhba-namespace-ul1411

    <userid>-aka-<username>-namespace

    cgezegvsb2nhba-aka-user1-namespace-6m2w2b