DevWorkspace Operator and workspace pods

The DevWorkspace Operator (DWO) manages workspace pods, services, and persistent volumes by reconciling DevWorkspace custom resources on Kubernetes. Every Che workspace has an underlying DevWorkspace CR that contains the devfile, editor definition, and configuration attributes.

The DevWorkspace CR is a Kubernetes resource representation of a Che workspace. Whenever a user creates a workspace using Che in the background, Dashboard Che creates a DevWorkspace CR in the cluster. For every Che workspace, there is an underlying DevWorkspace CR on the cluster.

DevWorkspace CR example
Figure 1. Example of a DevWorkspace CR in a cluster

When creating a workspace with Che with a devfile, the DevWorkspace CR contains the devfile details. Additionally, Che adds the editor definition into the DevWorkspace CR depending on which editor was chosen for the workspace. Che also adds attributes to the DevWorkspace that further configure the workspace depending on how you configured the CheCluster CR.

A DevWorkspaceTemplate is a custom resource that defines a reusable spec.template for DevWorkspaces.

When a workspace is started, DWO reads the corresponding DevWorkspace CR and creates the necessary resources such as deployments, secrets, configmaps, and routes. As a result, a workspace pod representing the development environment defined in the devfile is created.

The DevWorkspace Operator provides four Custom Resource Definitions:

  • DevWorkspace contains devfile details and a reference to the editor definition for each workspace.

  • DevWorkspaceTemplate defines reusable editor and component templates shared by multiple workspaces.

  • DevWorkspaceOperatorConfig defines configuration options for the DWO itself.

  • DevWorkspaceRouting specifies workspace container endpoints and routing.