You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 28, 2022. It is now read-only.
* Develop a simple microservice, using Eclipse Codewind on CodeReady Workspaces
14
+
* Develop a simple microservice that uses Eclipse Codewind on CodeReady Workspaces
15
15
16
16
## Overview
17
-
Eclipse Codewind enables you 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.
17
+
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.
18
18
19
19
## Developing with CodeReady Workspaces
20
-
CodeReady workspaces uses Kubernetes and containers to provide a preconfigured environment. CodeReady Workspaces allows you to create, build, and test your code in OpenShift containers but makes you feel like you are working on an IDE on your local machine.
20
+
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 computer.
21
21
22
22
### Prerequisite
23
23
CodeReady Workspaces requires at least two 1Gi ReadWriteOnce (RWO) persistent volumes on the cluster to install and a 1Gi RWO volume for each created workspace.
24
24
25
25
Each Codewind workspace also requires at least on 1Gi ReadWriteMany (RWX) persistent volume.
26
26
27
27
### Installing CodeReady Workspaces
28
-
To install CodeReady Workspaces, set `Spec.codeReadyWorkspaces.enable: true` in the Kabanero custom resource (Kabanero CR) instance and apply it.
29
-
30
-
To edit the Kabanero CR, you can run `oc edit kabanero -n kabanero` from the command line.
31
-
32
-
The following sample shows a Kabanero CR instance configuration:
33
-
28
+
1. Subscribe to the CodeReady Workspaces operator then install it.
29
+
* To manually install CodeReady Workspaces, apply the CodeReady Workspaces OperatorHub subscription.
30
+
2. After the CodeReady Workspaces operator is installed, create the CheCluster resources.
31
+
* If you have not set up an auth provider, set `openShiftoAuth` to `false`.
32
+
* To enable HTTPS, set `tlsSupport` to `true`.
33
+
* If you use a self-signed certificate, set `selfSignedCert` to `true`.
34
+
3. If you install Codewind alongside CodeReady Workspaces, use the following yaml:
* To manually install Codewind alongside Codewind Workspaces, save this yaml to a disk and run `oc apply -f <yaml>`.
73
+
4. CodeReady Workspaces now installs and you can access the CodeReady Workspaces URL and Red Hat SSO Admin Console URL.
53
74
54
-
### Configuring CodeReady Workspaces
55
-
The Kabanero CR instance provides additional fields allowing you to configure your installation of CodeReady Workspaces.
56
-
57
-
* If you want to install CodeReady Workspaces with TLS Support, set `Spec.codeReadyWorkspaces.operator.customResourceInstance.tlsSupport` to `true`.
58
-
**Note:** If your OpenShift cluster's router is set up with self-signed certificates, `Spec.codeReadyWorkspaces.operator.instance.selfSignedCert` must also be set to `true`.
59
-
* If you want to use your OpenShift accounts with CodeReady Workspaces, set up permanent users (accounts other than kube:admin) and then set `Spec.codeReadyWorkspaces.operator.customResourceInstance.openShiftOAuth` to `true`.
60
-
* To view the full list of configurable fields, see [Kabanero Custom Resource](../configuration/kabanero-cr-config.html).
61
-
62
-
### Installing Codewind
63
-
When CodeReady Workspaces is installed on your OpenShift cluster, complete the following steps:
64
-
65
-
1. Log in to CodeReady Workspaces.
66
-
2. Click **Create Workspace**.
67
-
3. For **Name**, give your workspace some meaningful name.
68
-
4. For **Select Stack**, select `Codewind`.
69
-
5. Click **Create & Open** to create and start Codewind in CodeReady Workspaces.
75
+
### Setting up Codewind
76
+
Before you can use Codewind with CodeReady Workspaces or Che, complete the following steps, either before or after you install Codewind:
70
77
71
-
CodeReady Workspaces starts Codewind and installs the Codewind plugins. This process might take a couple of minutes for all of the necessary components to be pulled and started.
78
+
1. Apply the Codewind cluster role with `oc apply -f`.
79
+
2. Because of its dependency on `buildah`, Codewind needs to run as root and privileged. To enable Codewind, run the following commands:
See (Codewind on Che documentation)[https://www.eclipse.org/codewind/mdt-che-installinfo.html] for additional information and next steps.
83
+
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.
74
84
75
85
### Configuring Codewind to use application stacks
76
86
Configure Codewind to use Appsody templates so you can focus exclusively on your code. These templates include an Eclipse MicroProfile stack that you can use to follow this guide. Complete the following steps to select the Appsody templates:
@@ -80,30 +90,30 @@ Configure Codewind to use Appsody templates so you can focus exclusively on your
80
90
3. Select `Template Source Manager`.
81
91
4. Enable `Appsody Stacks - incubator` and `Default templates`.
82
92
83
-
You have now configured Codewind to use Appsody templates and can proceed to develop your microservice within Codewind.
93
+
After you configured Codewind to use Appsody templates, continue to develop your microservice within Codewind.
84
94
85
-
If your organization uses customized application stacks and has given you a URL that points to an `index.json` file, you can add it to Codewind:
95
+
If your organization uses customized application stacks and gives you a URL that points to an `index.json` file, you can add it to Codewind:
86
96
87
97
1. Return to `Codewind` and right-click `Local`.
88
98
2. Select `Template Source Manager`.
89
-
3. Click the `Add New +` button to add your URL.
90
-
4. Add your URL in the popup window and save your changes.
99
+
3. Click `Add New +` to add your URL.
100
+
4. Add your URL in the pop-up window and save your changes.
91
101
92
102
### Creating an Appsody project
93
-
Throughout the application lifestyle, Appsody helps you develop containerized applications and leverage containers curated for your usage. If you want more context about Appsody, visit the [Appsody welcome page](https://appsody.dev/docs).
103
+
Throughout the application lifestyle, Appsody helps you develop containerized applications and maximize containers curated for your usage. If you want more context about Appsody, see [Appsody welcome page](https://appsody.dev/docs).
94
104
95
105
1. Under the Explorer pane, select `Codewind`.
96
106
2. Expand `Codewind` by clicking the drop-down arrow.
97
107
3. Hover over the `Projects` entry underneath Codewind in the Explorer pane, and press the `+` icon to create a project.
98
-
* **Note:** Make sure Docker is running. Otherwise, you get an error.
108
+
* **Note:** Make sure that Docker is running. Otherwise, you get an error.
99
109
4. Choose the `Appsody Open Liberty default template (Appsody Stacks - incubator)`.
100
110
5. Name your project `appsody-calculator`.
101
111
* If you don't see Appsody templates, find and select `Template Source Manager` and enable `Appsody Stacks - incubator`.
102
112
* The templates are refreshed, and the Appsody templates are available.
103
113
6. Press `Enter`.
104
-
* To monitor your project's progress, right-click your project, and select `Show all logs`. Then an `Output` tab is displayed where you see your project's build logs.
114
+
* To monitor your project's progress, right-click your project, and select `Show all logs`. Then, an `Output` tab is displayed where you see your project's build logs.
105
115
106
-
Your project is complete when you see your application status is running and your build status is successful.
116
+
Your project is complete when you see that your application status is running and your build status is successful.
107
117
108
118
### Accessing the application endpoint in a browser
109
119
1. Return to your project under the Explorer pane.
@@ -113,7 +123,7 @@ Your application is now opened in a browser, showing the welcome to your Appsody
113
123
114
124
### Adding a REST service to your application
115
125
1. Go to your project's workspace under the Explorer tab.
116
-
2. Navigate to `src->main->java->dev->appsody->starter`.
126
+
2. Go to `src->main->java->dev->appsody->starter`.
117
127
3. Right-click `starter` and select `New File`.
118
128
4. Create a file, name it `Calculator.java`, and press `Enter`. This file is your JAX-RS resource.
119
129
5. Populate the file with the following code and then **save** the file:
@@ -164,12 +174,12 @@ public class Calculator extends Application {
164
174
}
165
175
```
166
176
167
-
Any changes you make to your code are automatically built and re-deployed by Codewind and you can view them in your browser.
177
+
Any changes that you make to your code are automatically built and redeployed by Codewind and you can view them in your browser.
168
178
169
179
### Working with the example calculator microservice
170
180
You now can work with the example calculator microservice.
171
181
172
-
1. Use the exposed port number you saw when you first opened the application.
182
+
1. Use the port number that you saw when you first opened the application.
173
183
2. Make sure to remove the `< >` symbol in the URL.
0 commit comments