-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add getting-started-openshift-s2i (fixes #1306)
#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
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |