OCP DevSpaces: The GitOps Way

OpenShift Dev Spaces is a powerful developer workspace platform that provides consistent, secure, and zero-configuration development environments. In this post, we’ll explore what Dev Spaces is, its benefits, and how to deploy it using GitOps.
What is OpenShift Dev Spaces?
OpenShift Dev Spaces is the enterprise version of Eclipse Che, an open-source developer workspace server and cloud IDE. It enables developers to create pre-configured development environments that run directly in OpenShift clusters, making it easier to maintain consistency across development teams and reduce the time spent on environment setup.
Why Should You Care?
There are several compelling reasons to consider OpenShift Dev Spaces for your organization:
Consistency: Dev Spaces ensures that all developers work in identical environments, eliminating the “it works on my machine” problem.
Security: All development environments are contained within your OpenShift cluster, providing better control over source code and dependencies.
Zero Configuration: Developers can start coding immediately without spending time setting up their local development environment.
Resource Efficiency: Development environments can be started and stopped as needed, optimizing cluster resource usage.
Built-in IDE: Dev Spaces comes with a browser-based VS Code-like IDE, making it accessible from any device with a web browser.
OpenShift Deployment
What will be installed?
In my GitHub repository, I maintain an ArgoCD application that simplifies the deployment of Dev Spaces. The application uses Kustomize for configuration management and creates several key components:
Namespace: Creates the
openshift-devspaces
namespace where all Dev Spaces components will be deployed.Operator Subscription: Instals the operator using OLM.
CheCluster Custom Resource: Defines the Dev Spaces cluster configuration, including:
- Server components configuration
- Dashboard settings
- Devfile registry setup
- Image puller configuration for pre-pulling container images
- Metrics enablement
Kubernetes Image Puller operator:
- This optional operator automatically pre-pulls container images used by Dev Spaces (or any other application).
- Improves workspace startup time by having images readily available on nodes.
- Configured through
k8s-image-puller/kip-image-puller.yaml
. - Currently, only the
che-server
image is pre-pulled, but you can add more images as needed.
Monitoring Setup:
- ServiceMonitor for the DevWorkspace controller.
- Custom Grafana Dashboard for Dev Spaces metrics.
Custom Dev File:
- A custom workspace to deploy an environment ready to run. You can find it here.
- Adding custom Dev Files is as simple as creating a ConfigMap with certain labels in the
openshift-devspaces
namespace.
How to Deploy?
To use my GitOps configuration, you just need to create a new ArgoCD application pointing to my repository:
|
|
With this GitOps-based setup, you can easily deploy and manage Dev Spaces across your OpenShift clusters, providing your development teams with a powerful, consistent, and secure development environment.
Using Dev Spaces
WIP
Conclusion
OpenShift Dev Spaces is a game-changer for development teams, providing a consistent, secure, and efficient way to manage development environments. By leveraging GitOps for deployment, you can ensure that your Dev Spaces setup is reproducible, manageable, and scalable.