|
| 1 | +--- |
| 2 | +layout: guide |
| 3 | +summary_title: "Codewind in CodeReady Workspaces" |
| 4 | +title: "Getting Started with Codewind in CodeReady Workspaces" |
| 5 | +categories: guides |
| 6 | +description: "Use CodeReady Workspaces to develop cloud-native applications from an OpenShift cluster." |
| 7 | +permalink: codewind-crw-quick-guide.html |
| 8 | +duration: 10 minutes |
| 9 | +keywords: Codewind, CodeReady Workspaces, OpenShift |
| 10 | +objectives: ["Install CodeReady Workspaces and Codewind.", "Create a Codewind workspace within CodeReady Workspaces."] |
| 11 | +icon: images/learn/icon_cloud.svg |
| 12 | +--- |
| 13 | + |
| 14 | +## Overview |
| 15 | +Use Eclipse Codewind to develop microservice applications from application stacks in an integrated developer environment (IDE). CodeReady Workspaces provides a containerized IDE for cloud-native application development on an OpenShift cluster. |
| 16 | + |
| 17 | +## Developing with CodeReady Workspaces |
| 18 | +CodeReady Workspaces uses Kubernetes and containers to provide a preconfigured environment. Use CodeReady Workspaces to create, build, and test your code in OpenShift containers but feel like you are working on an IDE on your local machine. |
| 19 | + |
| 20 | +### Prerequisite |
| 21 | +Before you can use Codewind with CodeReady Workspaces, you must have an OpenShift cluster available. To install OpenShift clusters, see [CodeReady Containers](https://code-ready.github.io/crc/). |
| 22 | + |
| 23 | +CodeReady Workspaces require at least two 5Gi ReadWriteOnce (RWO) persistent volumes on the cluster to install and a 5Gi RWO volume for each created workspace. |
| 24 | + |
| 25 | +Each Codewind workspace also requires at least one 5Gi ReadWriteMany (RWX) persistent volume. |
| 26 | + |
| 27 | +### Installing CodeReady Workspaces |
| 28 | +1\. Log in to your OpenShift cluster's dashboard. |
| 29 | + |
| 30 | +2\. From the sidebar, click **Operators** then **OperatorHub**. |
| 31 | + |
| 32 | +3\. Search for `CodeReady Workspaces`. |
| 33 | + |
| 34 | +4\. Select **Red Hat CodeReady Workspaces**: |
| 35 | + |
| 36 | +{:width="900"}. |
| 37 | + |
| 38 | +5\. Click **Install**: |
| 39 | + |
| 40 | +{:width="800"}. |
| 41 | + |
| 42 | +After you install the operator, continue to install CodeReady Workspaces: |
| 43 | + |
| 44 | +1\. From the OpenShift dashboard, go to `Operators`>`Installed Operators`. |
| 45 | + |
| 46 | +2\. Select **CodeReady Workspaces**. |
| 47 | + |
| 48 | +3\. Select the **CodeReady Workspaces** cluster then **Create CheCluster**. |
| 49 | + |
| 50 | +4\. Configure the fields, like **tlsSupport**, as needed. |
| 51 | + |
| 52 | +5\. Copy and paste the following yaml into the provided text box: |
| 53 | + |
| 54 | +```yaml |
| 55 | +apiVersion: org.eclipse.che/v1 |
| 56 | +kind: CheCluster |
| 57 | +metadata: |
| 58 | + name: codeready-workspaces |
| 59 | +spec: |
| 60 | + server: |
| 61 | + cheImageTag: '' |
| 62 | + cheFlavor: codeready |
| 63 | + devfileRegistryImage: '' |
| 64 | + pluginRegistryImage: '' |
| 65 | + tlsSupport: true |
| 66 | + selfSignedCert: true |
| 67 | + cheWorkspaceClusterRole: 'eclipse-codewind' |
| 68 | + customCheProperties: |
| 69 | + CHE_INFRA_KUBERNETES_WORKSPACE__START__TIMEOUT__MIN: "15" |
| 70 | + CHE_LIMITS_WORKSPACE_IDLE_TIMEOUT: "0" |
| 71 | + CHE_WORKSPACE_PLUGIN__BROKER_WAIT__TIMEOUT__MIN: "15" |
| 72 | + database: |
| 73 | + externalDb: false |
| 74 | + chePostgresHostName: '' |
| 75 | + chePostgresPort: '' |
| 76 | + chePostgresUser: '' |
| 77 | + chePostgresPassword: '' |
| 78 | + chePostgresDb: '' |
| 79 | + auth: |
| 80 | + openShiftoAuth: false |
| 81 | + identityProviderImage: '' |
| 82 | + externalIdentityProvider: false |
| 83 | + identityProviderURL: '' |
| 84 | + identityProviderRealm: '' |
| 85 | + identityProviderClientId: '' |
| 86 | + storage: |
| 87 | + pvcStrategy: per-workspace |
| 88 | + pvcClaimSize: 1Gi |
| 89 | + preCreateSubPaths: true |
| 90 | +``` |
| 91 | +
|
| 92 | + {:width="900"}. |
| 93 | +
|
| 94 | + * **Note:** If you install CodeReady Workspaces on an OpenShift cluster with publicly signed certificates, such as on IBM Cloud, set **selfSignedCert** to **false**. |
| 95 | + |
| 96 | +6\. After CodeReady Workspaces installs, click the **CodeReady Workspaces URL**. |
| 97 | +
|
| 98 | +7\. A new window appears that prompts you to log in. If you have not made a CodeReady Workspaces account, do so by clicking **Register**: |
| 99 | +
|
| 100 | +{:width="900"}. |
| 101 | +
|
| 102 | +8\. After you make a CodeReady Workspaces account, you can start to create a Codewind workspace. |
| 103 | +
|
| 104 | +### Setting up Codewind |
| 105 | +Because of its dependency on `buildah`, Codewind needs to run as root and privileged. To enable Codewind, run the following commands from your command line: |
| 106 | + * `oc adm policy add-scc-to-user anyuid system:serviceaccounts:<namespace where you installed CodeReady Workspaces>:che-workspace` |
| 107 | + * `oc adm policy add-scc-to-user privileged system:serviceaccounts:<namespace where you installed CodeReady Workspaces>:che-workspace` |
| 108 | + |
| 109 | +CodeReady Workspaces starts Codewind and installs the Codewind plug-ins. This process might take a couple of minutes for all of the necessary components to be pulled and started. |
| 110 | + |
| 111 | +### Creating the Codewind workspace |
| 112 | +After you set up Codewind, log in to your CodeReady Workspaces account and create a Codewind workspace from the Codewind devfile: |
| 113 | + |
| 114 | +1\. Log in to CodeReady Workspaces. |
| 115 | + |
| 116 | +2\. Go to **Workspaces** then click **Add Workspace**. |
| 117 | + |
| 118 | +3\. Click **Import Devfile**. |
| 119 | + |
| 120 | +4\. From **Source**, click **YAML**. |
| 121 | + |
| 122 | +5\. Go to the link, [codewind-che-plugin/0.13.0/devfile.yaml](https://raw.githubusercontent.com/eclipse/codewind-che-plugin/0.13.0/devfiles/0.13.0/devfile.yaml), then copy and paste the contents into the YAML text box in your Codewind workspace. |
| 123 | + |
| 124 | +6\. Click **Create & Open**. |
| 125 | + |
| 126 | +## What you have learned |
| 127 | +Now that you have completed this quick guide, you have learned to: |
| 128 | + |
| 129 | +1. Install CodeReady Workspaces and Codewind. |
| 130 | +2. Create a Codewind workspace within CodeReady Workspaces. |
| 131 | + |
| 132 | +## Next Steps |
| 133 | +See other quick guides to learn how to develop with Codewind: |
| 134 | + |
| 135 | +* [Codewind in Eclipse](codewind-eclipse-quick-guide.html) |
| 136 | +* [Codewind in VS Code](https://www.eclipse.org/codewind/codewind-vscode-quick-guide.html) |
0 commit comments