diff --git a/examples/eap-xp5/getting-started/README.adoc b/examples/eap-xp5/getting-started/README.adoc new file mode 100644 index 0000000..b936bb5 --- /dev/null +++ b/examples/eap-xp5/getting-started/README.adoc @@ -0,0 +1,68 @@ +# Install a MicroProfile Application +:toc: left +:icons: font +:idprefix: +:idseparator: - +:keywords: openshift,wildfly,microprofile,helm + +This example shows how to deploy a Java application with EAP XP 5 on OpenShift. + +## Prerequisites + +## Source Code + +The source code for the backend is hosted at https://github.com/jboss-eap-up-and-running/eap-xp5-getting-started.git + +It is a simple application that uses JAX-RS to exposes HTTP endpoint. + +## Installation + +The application is built with Bootable Jar. + +### Installation with Bootable Jar + +The application can be compiled as a Bootable Jar. +In that case, the Helm Chart is configured with `build.mode=bootable-jar`. + +[source,options="nowrap"] +---- +$ helm install eap-xp5-app -f examples/eap-xp5/getting-started/app.yaml ./charts/eap-xp5 +---- + +## Deployment + +Once the chart is installed, let's wait for the application to be built and deployed: + +[source,options="nowrap"] +---- +$ oc get deployment/eap-xp5-app -w +NAME READY UP-TO-DATE AVAILABLE AGE +eap-xp5-app 0/1 1 0 27s +... +eap-xp5-app 1/1 1 1 5m29s +---- + +## Use the application + +Once the application is deployed on OpenShift, it can be accessed from the route `eap-xp5-app`. +Let's find the host that we can use to connect to this backend: + +[source,options="nowrap"] +---- +$ oc get route eap-xp5-app -o jsonpath="{.spec.host}" +eap-xp5-app-jmesnil1-dev.apps.sandbox.x8i5.p1.openshiftapps.com +---- + +This value will be different for every installation of the application. + +We can then query this application by calling one of its HTTP endpoints from the URL above. + +## Clean up + +The application can be deleted by running the command: + +[source,options="nowrap"] +---- +$ helm delete eap-xp5-app +release "eap-xp5-app " uninstalled +---- diff --git a/examples/eap-xp5/getting-started/app.yaml b/examples/eap-xp5/getting-started/app.yaml new file mode 100644 index 0000000..78428e3 --- /dev/null +++ b/examples/eap-xp5/getting-started/app.yaml @@ -0,0 +1,3 @@ +build: + uri: https://github.com/jboss-eap-up-and-running/eap-xp5-getting-started.git + mode: bootable-jar diff --git a/examples/eap-xp5/microprofile-config/README.adoc b/examples/eap-xp5/microprofile-config/README.adoc deleted file mode 100644 index 76775fa..0000000 --- a/examples/eap-xp5/microprofile-config/README.adoc +++ /dev/null @@ -1,77 +0,0 @@ -# Install a MicroProfile Application -:toc: left -:icons: font -:idprefix: -:idseparator: - -:keywords: openshift,wildfly,microprofile,helm - -This example shows how to deploy an Eclipse MicroProfile application with EAP XP 5 on OpenShift. - -## Prerequisites - -## Source Code - -The source code for the backend is hosted at https://github.com/jboss-developer/jboss-eap-quickstarts.git - -It is a simple MicroProfile application that uses JAX-RS to exposes HTTP endpoints that displays text configured with MicroProfile Config. - -When the application is deployed on OpenShift, it uses the `CONFIG_PROP` environment variable as the source of its config property. -This environment variable is specified in the `deploy.env` section of the Helm Chart. - -## Installation - -The application can be built with Bootable Jar or using EAP 8.0 S2I images. - -### Installation with Bootable Jar - -The application can be compiled as a Bootable Jar. -In that case, the Helm Chart is configured with `build.mode=bootable-jar`. - -[source,options="nowrap"] ----- -$ helm install microprofile-config-app -f examples/eap-xp5/microprofile-config/microprofile-config-app.yaml ./charts/eap-xp5 ----- - -## Deployment - -Once the chart is installed, let's wait for the application to be built and deployed: - -[source,options="nowrap"] ----- -$ oc get deployment/microprofile-config-app -w -NAME READY UP-TO-DATE AVAILABLE AGE -microprofile-config-app 0/1 1 0 27s -... -microprofile-config-app 1/1 1 1 5m29s ----- - -## Use the application - -Once the application is deployed on OpenShift, it can be accessed from the route `microprofile-config-app`. -Let's find the host that we can use to connect to this backend: - -[source,options="nowrap"] ----- -$ oc get route microprofile-config-app -o jsonpath="{.spec.host}" -microprofile-config-app-jmesnil1-dev.apps.sandbox.x8i5.p1.openshiftapps.com ----- - -This value will be different for every installation of the application. - -We can then query this application by calling one of its HTTP endpoints: - -[source,options="nowrap"] ----- -$ curl -L $(oc get route microprofile-config-app -o jsonpath="{.spec.host}")/config/value -Hello from OpenShift ----- - -## Clean up - -The application can be deleted by running the command: - -[source,options="nowrap"] ----- -$ helm delete microprofile-config-app -release "microprofile-config-app" uninstalled ----- diff --git a/examples/eap-xp5/microprofile-config/microprofile-config-app.yaml b/examples/eap-xp5/microprofile-config/microprofile-config-app.yaml deleted file mode 100644 index 97930ad..0000000 --- a/examples/eap-xp5/microprofile-config/microprofile-config-app.yaml +++ /dev/null @@ -1,9 +0,0 @@ -build: - uri: https://github.com/jbossas/eap-quickstarts.git - ref: EAP_XP_5.0.0.GA-dev - contextDir: microprofile-config - mode: bootable-jar -deploy: - env: - - name: CONFIG_PROP - value: Hello from OpenShift \ No newline at end of file