Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add getting-started-openshift-s2i (fixes #1306) #1353

Merged
merged 4 commits into from
Mar 28, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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].
vorburger marked this conversation as resolved.
Show resolved Hide resolved

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 registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift~https://github.com/quarkusio/quarkus-quickstarts --context-dir=getting-started-openshift-s2i --name=quarkus-quickstart
vorburger marked this conversation as resolved.
Show resolved Hide resolved
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.