Skip to content

devfile/devworkspace-operator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevWorkspace operator

DevWorkspace Operator

codecov OpenSSF Best Practices OpenSSF Scorecard

DevWorkspace operator repository that contains the controller for the DevWorkspace Custom Resource. The Kubernetes API of the DevWorkspace is defined in the https://github.com/devfile/api repository.

What is the DevWorkspace Operator?

A Kubernetes Operator to run fast, repeatable and scalable Cloud Development Environments.

Install it and apply a DevWorkspace to create a Cloud Development Environment:
dw apply demo

Get the Cloud Developent Environment URI:
dw get demo

Open the IDE:

Visual Studio Code JetBrains IntelliJ
vscode intellij

Example

Here is a sample DevWorkspace to provision a Cloud Development Environment for the project github.com/l0rd/outyet with Visual Studio Code as the editor and quay.io/devfile/universal-developer-image:ubi8-latest as the development tooling container image.

devworkspace

DevWorkspace Template

The Template section of a DevWorkspace is actually a Devfile: the spec.template schema matches the Devfile schema. ⚠️ A few Devfile APIs are not supported yet.

DevWorkspace Contributions

Contributions are extra Templates that are added on top of the main DevWorkspaceTemplate. Contributions are used to inject editors such as Visual Studio Code and JetBrains. Contributions are defined as Devfile or DevWorkspace Templates. Examples are the Visual Studio Code devfile and the JetBrains IntelliJ devfile.

Additional configuration

DevWorkspaces can be further configured through DevWorkspace attributes, labels and annotations. For a list of all options available, see additional documentation.

DevWorkspace Operator Installation

This section describes how to install the Operator on a cluster using the Operator Lifecycle Manager (OLM). The file CONTRIBUTING.md has instructions to install the Operator, using the Makefile, without requiring OLM.

Installing the Operator Lifecycle Manager

The Operator Framework website has general instructions to install OLM in your cluster. On Minikube, OLM is available as an addon. OLM is pre-installed on OpenShift.

Adding the DevWorkspace Operator catalog source

If the DevWorkspace Operator is not already available amongst the PackageManifests (use command kubectl get packagemanifest -n olm | grep devworkspace to check it) you should add a CatalogSource in the cluster:

kubectl apply -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: devworkspace-operator-catalog
  namespace: openshift-marketplace # Namespace for catalogsource, not operator itself
spec:
  sourceType: grpc
  image: quay.io/devfile/devworkspace-operator-index:next
  publisher: Red Hat
  displayName: DevWorkspace Operator Catalog
  updateStrategy:
    registryPoll:
      interval: 5m
EOF

Two index images are available for installing the DevWorkspace Operator:

  • quay.io/devfile/devworkspace-operator-index:release - multi-version catalog with all DevWorkspace Operator releases
  • quay.io/devfile/devworkspace-operator-index:next - single-version catalog that will deploy the latest commit in the main branch

Both index images allow automatic updates (to either the latest release or latest commit in main).

Create the DevWorkspace Operator Subscription

To install the DevWorkspace Operator, create a OLM Subscription with the following command:

kubectl apply -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: devworkspace-operator
  namespace: openshift-operators
spec:
  channel: next                            # <--- `next` or `release`
  installPlanApproval: Automatic
  name: devworkspace-operator
  source: devworkspace-operator-catalog    # <--- the catalog created in the previous step
  sourceNamespace: openshift-marketplace
EOF

Contributing

For information on contributing to this project please see CONTRIBUTING.md.