From 24e3dc46a340a03dc49d0952b1d97d3e01c7f5f8 Mon Sep 17 00:00:00 2001 From: Jack Hu <56557114+jackhu008@users.noreply.github.com> Date: Wed, 7 Oct 2020 22:34:48 +0100 Subject: [PATCH] Added detailed commands for deploying to OpenShift and how to test the app --- .../asciidoc/deploying-to-kubernetes.adoc | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/src/main/asciidoc/deploying-to-kubernetes.adoc b/docs/src/main/asciidoc/deploying-to-kubernetes.adoc index 93e14ef961f88..7e8ce750f4069 100644 --- a/docs/src/main/asciidoc/deploying-to-kubernetes.adoc +++ b/docs/src/main/asciidoc/deploying-to-kubernetes.adoc @@ -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 /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] @@ -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`: