Deploy OpenShift Dev Spaces declaratively through OpenShift GitOps (Argo CD) so that every configuration change is tracked in Git, auditable, and automatically reconciled on the cluster.
Before you begin
You have an OpenShift Container Platform 4.22 or later cluster with cluster-admin access.
You have a Git repository accessible from the cluster (GitHub, GitLab, Bitbucket, or an internal Git server).
About this task
With this method, you store the Operator subscription and CheCluster configuration in a Git repository. Argo CD monitors the repository and applies changes to the cluster automatically. You manage OpenShift Dev Spaces through Git commits instead of direct cluster commands.
Procedure
In your Git repository, create a directory for the OpenShift Dev Spaces manifests. The directory contains three files: the Operator subscription, the CheCluster custom resource, and a Kustomize configuration.
Required because the CheCluster custom resource definition (CRD) does not exist until the Operator installs it. This option tells Argo CD to skip validation for unknown resource types and apply them directly.
selfHeal
Reverts manual changes on the cluster to match the Git repository state.
Wait for Argo CD to sync the resources. The Operator installs first, registers the CheCluster CRD, and then Argo CD applies the CheCluster custom resource.
Results
Verify that the Argo CD Application reports Synced and Healthy:
$ oc get checluster devspaces -n openshift-devspaces \
-o jsonpath='{.status.chePhase}'
Expected output: Active
Retrieve the OpenShift Dev Spaces dashboard URL and open it in a browser:
$ oc get checluster devspaces -n openshift-devspaces \
-o jsonpath='{.status.cheURL}'
Sync fails with "CheCluster CRD not found": Verify that the Argo CD Application includes SkipDryRunOnMissingResource=true in the syncOptions.
Operator reports "OwnNamespace InstallModeType not supported": The Subscription must target the openshift-operators namespace (AllNamespaces mode). Do not place the Subscription in the openshift-devspaces namespace.
Sync retries but CheCluster is not created: The Operator may still be installing. Wait for the ClusterServiceVersion to reach Succeeded:
$ oc get csv -n openshift-operators | grep devspaces