Limit the number of workspaces that all users can run simultaneously

Limit the number of concurrently running workspaces across the cluster to manage resource consumption. By default, all users can run an unlimited number of workspaces.

Before you begin

Procedure

  1. Configure the maxNumberOfRunningWorkspacesPerCluster in the CheCluster Custom Resource:
    spec:
      devEnvironments:
        maxNumberOfRunningWorkspacesPerCluster: <running_workspaces_limit>

    where:

    <running_workspaces_limit>
    The maximum number of concurrently running workspaces across the entire Kubernetes cluster. This applies to all users in the system. The -1 value means there is no limit on the number of running workspaces.
  2. Apply the change:
    $ oc patch checluster/devspaces -n openshift-devspaces \
    --type='merge' -p \
    '{"spec":{"devEnvironments":{"maxNumberOfRunningWorkspacesPerCluster": <running_workspaces_limit>}}}'

Results

  • Verify the maxNumberOfRunningWorkspacesPerCluster value in the CheCluster Custom Resource:
    $ oc get checluster devspaces -n openshift-devspaces -o jsonpath='{.spec.devEnvironments.maxNumberOfRunningWorkspacesPerCluster}'