|
| 1 | +# Install a MicroProfile Application |
| 2 | +:toc: left |
| 3 | +:icons: font |
| 4 | +:idprefix: |
| 5 | +:idseparator: - |
| 6 | +:keywords: openshift,wildfly,microprofile,helm |
| 7 | + |
| 8 | +This example shows how to deploy a Java application with EAP XP 5 on OpenShift. |
| 9 | + |
| 10 | +## Prerequisites |
| 11 | + |
| 12 | +## Source Code |
| 13 | + |
| 14 | +The source code for the backend is hosted at https://github.com/jboss-eap-up-and-running/eap-xp5-getting-started.git |
| 15 | + |
| 16 | +It is a simple application that uses JAX-RS to exposes HTTP endpoint. |
| 17 | + |
| 18 | +## Installation |
| 19 | + |
| 20 | +The application is built with Bootable Jar. |
| 21 | + |
| 22 | +### Installation with Bootable Jar |
| 23 | + |
| 24 | +The application can be compiled as a Bootable Jar. |
| 25 | +In that case, the Helm Chart is configured with `build.mode=bootable-jar`. |
| 26 | + |
| 27 | +[source,options="nowrap"] |
| 28 | +---- |
| 29 | +$ helm install eap-xp5-app -f examples/eap-xp5/getting-started/app.yaml ./charts/eap-xp5 |
| 30 | +---- |
| 31 | + |
| 32 | +## Deployment |
| 33 | + |
| 34 | +Once the chart is installed, let's wait for the application to be built and deployed: |
| 35 | + |
| 36 | +[source,options="nowrap"] |
| 37 | +---- |
| 38 | +$ oc get deployment/eap-xp5-app -w |
| 39 | +NAME READY UP-TO-DATE AVAILABLE AGE |
| 40 | +eap-xp5-app 0/1 1 0 27s |
| 41 | +... |
| 42 | +eap-xp5-app 1/1 1 1 5m29s |
| 43 | +---- |
| 44 | + |
| 45 | +## Use the application |
| 46 | + |
| 47 | +Once the application is deployed on OpenShift, it can be accessed from the route `eap-xp5-app`. |
| 48 | +Let's find the host that we can use to connect to this backend: |
| 49 | + |
| 50 | +[source,options="nowrap"] |
| 51 | +---- |
| 52 | +$ oc get route eap-xp5-app -o jsonpath="{.spec.host}" |
| 53 | +eap-xp5-app-jmesnil1-dev.apps.sandbox.x8i5.p1.openshiftapps.com |
| 54 | +---- |
| 55 | + |
| 56 | +This value will be different for every installation of the application. |
| 57 | + |
| 58 | +We can then query this application by calling one of its HTTP endpoints from the URL above. |
| 59 | + |
| 60 | +## Clean up |
| 61 | + |
| 62 | +The application can be deleted by running the command: |
| 63 | + |
| 64 | +[source,options="nowrap"] |
| 65 | +---- |
| 66 | +$ helm delete eap-xp5-app |
| 67 | +release "eap-xp5-app " uninstalled |
| 68 | +---- |
0 commit comments