This section describes how to calculate the resources required for a workspace. It is the sum of the resources required for each component of this workspace.

These examples demonstrate the necessity of a proper calculation:

  • A workspace with 10 active plug-ins requires more resources then the same workspace with fewer plug-ins.

  • A standard Java workspace requires more resources than a standard Node.js workspace because running builds, tests, and application debugging requires more resources.

Procedure
  1. Identify the workspace components explicitly specified in the components section of the devfile.

  2. Identify the implicit workspace components:

    1. Che implicitly loads the default cheEditor: che-theia, and the chePlugin that allows commands execution: che-machine-exec-plugin. To change the default editor, add a cheEditor component section in the devfile.

    2. When Che is running in multi-user mode, it loads the JWT Proxy component. The JWT Proxy is responsible for the authentication and authorization of the external communications of the workspace components.

  3. Calculate the requirements for each component:

    1. Default values:

      The following table presents the default requirements for all workspace components. It also presents the corresponding Che server property to modify the defaults cluster-wide.

      Table 1. Default requirements of workspace components by type
      Component types Che server property Default memory limit Default memory request

      chePlugin

      che.workspace.sidecar.default_memory_limit_mb

      128 MiB

      128 MiB

      cheEditor

      che.workspace.sidecar.default_memory_limit_mb

      128 MiB

      128 MiB

      kubernetes, openshift, dockerimage

      che.workspace.default_memory_limit_mb, che.workspace.default_memory_request_mb

      1 Gi

      512 MiB

      JWT Proxy

      che.server.secure_exposer.jwtproxy.memory_limit

      128 MiB

      128 MiB

    2. Custom requirements for chePlugins and cheEditors components:

      1. Custom memory limit and request:

        If present, the memoryLimit attribute of the containers section of the meta.yaml file defines the memory limit of a chePlugins or cheEditors component. Che automatically sets the memory request to match the memory limit. There is no attribute in a meta.yaml file to set the memory request.

        Example 1. The chePlugin che-incubator/typescript/latest
        meta.yaml spec section:
        spec:
         containers:
           - image: docker.io/eclipse/che-remote-plugin-node:next
             name: vscode-typescript
             memoryLimit: 512Mi

        It results in a container with the following memory limit and request:

        Memory limit

        512 MiB

        Memory request

        512 MiB

        How to find the meta.yaml file of chePlugin

        Community plug-ins are available in the che-plugin-registry GitHub repository in folder v3/plugins/${organization}/${name}/${version}/.

        For non-community or customized plug-ins, the meta.yaml files are available on the local Kubernetes cluster at ${pluginRegistryEndpoint}/v3/plugins/${organization}/${name}/${version}/meta.yaml.

        For example, on a local Minikube cluster, the URL for the che-incubator/typescript/latest meta.yaml is http://plugin-registry-che.192.168.64.78.nip.io/v3/plugins/che-incubator/typescript/latest/meta.yaml.

      2. Custom CPU limit and request:

        Che does not set CPU limits and requests. The LimitRange Kubernetes namespace may specify some defaults for CPU limits and requests. Kubernetes apply them to the chePlugin container.

    3. Custom requirements for dockerimage components

      If present, the memoryLimit attribute of the devfile defines the memory limit of a dockerimage container. Che set automatically the memory request to match the memory limit. There is no attribute in a devfile to set the memory request.

        - alias: maven
          type: dockerimage
          image: eclipse/maven-jdk8:latest
          memoryLimit: 1536M
    4. Custom requirements for kubernetes or openshift components:

      The referenced manifest may define the memory requirements and limits.

  4. Add all requirements previously calculated.