Chapter 8. Integrating with OpenShift
8.1. Automatic OpenShift token injection
This section describes how to use the OpenShift user token that is automatically injected into workspace containers which allows running OpenShift Dev Spaces CLI commands against OpenShift cluster.
Procedure
- Open the OpenShift Dev Spaces dashboard and start a workspace.
- Once the workspace is started, open a terminal in the container that contains the OpenShift Dev Spaces CLI.
Execute OpenShift Dev Spaces CLI commands which allow you to run commands against OpenShift cluster. CLI can be used for deploying applications, inspecting and managing cluster resources, and viewing logs. OpenShift user token will be used during the execution of the commands.
The automatic token injection currently works only on the OpenShift infrastructure.
8.2. Navigating Dev Spaces from OpenShift Developer Perspective
The OpenShift Container Platform web console provides two perspectives; the Administrator perspective and the Developer perspective.
The Developer perspective provides workflows specific to developer use cases, such as the ability to:
- Create and deploy applications on the OpenShift Container Platform by importing existing codebases, images, and Dockerfiles.
- Visually interact with applications, components, and services associated with them within a project and monitor their deployment and build status.
- Group components within an application and connect the components within and across applications.
- Integrate serverless capabilities (Technology Preview).
- Create workspaces to edit your application code using OpenShift Dev Spaces.
8.2.1. OpenShift Developer Perspective integration with OpenShift Dev Spaces
This section provides information about OpenShift Developer Perspective support for OpenShift Dev Spaces.
When the OpenShift Dev Spaces Operator is deployed into OpenShift Container Platform 4.2 and later, it creates a ConsoleLink
Custom Resource (CR). This adds an interactive link to the Red Hat Applications menu for accessing the OpenShift Dev Spaces installation using the OpenShift Developer Perspective console.
To access the Red Hat Applications menu, click the three-by-three matrix icon on the main screen of the OpenShift web console. The OpenShift Dev Spaces Console Link, displayed in the drop-down menu, creates a new workspace or redirects the user to an existing one.
OpenShift Container Platform console links are not created when OpenShift Dev Spaces is used with HTTP resources
When installing OpenShift Dev Spaces with the From Git option, the OpenShift Developer Perspective console link is only created if OpenShift Dev Spaces is deployed with HTTPS. The console link will not be created if an HTTP resource is used.
8.2.2. Editing the code of applications running in OpenShift Container Platform using OpenShift Dev Spaces
This section describes how to start editing the source code of applications running on OpenShift using OpenShift Dev Spaces.
Prerequisites
- OpenShift Dev Spaces is deployed on the same OpenShift 4 cluster.
Procedure
- Open the Topology view to list all projects.
-
In the Select an Application search field, type
workspace
to list all workspaces. Click the workspace to edit.
The deployments are displayed as graphical circles surrounded by circular buttons. One of these buttons is Edit Source Code.
- To edit the code of an application using OpenShift Dev Spaces, click the Edit Source Code button. This redirects to a workspace with the cloned source code of the application component.
8.2.3. Accessing OpenShift Dev Spaces from Red Hat Applications menu
This section describes how to access OpenShift Dev Spaces workspaces from the Red Hat Applications menu on the OpenShift Container Platform.
Prerequisites
- The OpenShift Dev Spaces Operator is available in OpenShift 4.
Procedure
Open the Red Hat Applications menu by using the three-by-three matrix icon in the upper right corner of the main screen.
The drop-down menu displays the available applications.
- Click the OpenShift Dev Spaces link to open the Dev Spaces Dashboard.
8.3. Navigating OpenShift web console from Dev Spaces
This section describes how to access OpenShift web console from OpenShift Dev Spaces.
Prerequisites
- The OpenShift Dev Spaces Operator is available in OpenShift 4.
Procedure
Open the OpenShift Dev Spaces dashboard and click the three-by-three matrix icon in the upper right corner of the main screen.
The drop-down menu displays the available applications.
- Click the OpenShift console link to open the OpenShift web console.