Skip to content

Commit

Permalink
add getting-started-openshift-s2i (fixes #1306)
Browse files Browse the repository at this point in the history
#1306

see also #1305

requires quarkusio/quarkus-quickstarts#81

and then to actually publish the link to this new guide in the menu
it needs quarkusio/quarkusio.github.io#126
  • Loading branch information
vorburger committed Mar 8, 2019
1 parent fd5d634 commit e3a8fb4
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions docs/src/main/asciidoc/openshift-s2i-guide.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
include::./attributes.adoc[]
= {project-name} - Deploying on OpenShift with S2I

This guide covers:

* The deployment of the application to OpenShift using S2I to build
== Prerequisites

For this guide you need:

* roughly 10 minutes
* having access to an OpenShift cluster. Minishift is a valid option.

== Solution

We recommend to follow the instructions in the next sections and build the application step by step.
However, you can go right to the completed example.

Clone the Git repository: `git clone {quickstarts-clone-url}`, or download an {quickstarts-archive-url}[archive].

The solution is located in the `getting-started-openshift-s2i` directory.

== Deploying the application in OpenShift

In this section, we are going to leverage the S2I build mechanism of OpenShift.
We use a Java S2I Builder, and therefore do not need a `Dockerfile` in this approach.
You do not need to locally clone the Git repository, as it will be directly built since OpenShift.
We are going to create an OpenShift `build` executing it:

[source,shell]
----
# To build the image on OpenShift
oc new-app fabric8/s2i-java:latest-java11~https://github.com/quarkusio/quarkus-quickstarts --context-dir=getting-started-openshift-s2i --name=quarkus-quickstart
oc logs -f bc/quarkus-quickstart
# To create the route
oc expose svc/quarkus-quickstart
# Get the route URL
export URL="http://$(oc get route | grep quarkus-quickstart | awk '{print $2}')"
curl $URL/hello/greeting/quarkus
----

Your application is accessible at the printed URL.

== Going further

This guide covered the deployment of a Quarkus application on OpenShift.
However, there is much more, and the integration with these environments has been tailored to make Quarkus applications execution very smooth.
For instance, the health extension can be used for health check; the configuration support allows mounting the application configuration using config map, the metric extension produces data _scrappable_ by Prometheus and so on.

0 comments on commit e3a8fb4

Please sign in to comment.