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

Added detailed for deploying to OpenShift and how to test the app #12590

Merged
merged 1 commit into from
Oct 13, 2020
Merged
Changes from all 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
22 changes: 21 additions & 1 deletion docs/src/main/asciidoc/deploying-to-kubernetes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,26 @@ Allowed values: `cluster-ip`, `node-port`, `load-balancer`, `external-name`
[#openshift]
=== OpenShift

One way to deploy an application to OpenShift is to use s2i (source to image) to create an image stream from the source and then deploy the image stream:

[source]
----
./mvnw quarkus:remove-extension -Dextensions="kubernetes, jib"
./mvnw quarkus:add-extension -Dextensions="openshift"

oc new-project quarkus-project
./mvnw clean package -Dquarkus.container-image.build=true

oc new-app --name=greeting quarkus-project/kubernetes-quickstart:1.0-SNAPSHOT
oc expose svc/greeting
oc get route
curl <route>/greeting
----

See further information in link:deploying-to-openshift[Deploying to OpenShift].

A description of OpenShift resources and customisable properties is given below alongside Kubernetes resources to show similarities where applicable. This includes an alternative to `oc new-app ...` above, i.e. `oc apply -f target/kubernetes/openshift.json` .

To enable the generation of OpenShift resources, you need to include OpenShift in the target platforms:

[source]
Expand All @@ -721,7 +741,7 @@ If you need to generate resources for both platforms (vanilla Kubernetes and Ope
quarkus.kubernetes.deployment-target=kubernetes,openshift
----

Following the execution of `./mvnw package` you will notice amongst the other files that are created, two files named
Following the execution of `./mvnw package -Dquarkus.container-image.build=true ` you will notice amongst the other files that are created, two files named
`openshift.json` and `openshift.yml` in the `target/kubernetes/` directory.

These manifests can be deployed as is to a running cluster, using `kubectl`:
Expand Down