You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/main/asciidoc/deploying-to-openshift-docker-howto.adoc
+17-21Lines changed: 17 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,18 +15,18 @@ include::_attributes.adoc[]
15
15
As an application developer, you can deploy your applications to {openshift} by using the Docker build strategy as a deployment option.
16
16
This functionality is provided by the `quarkus-openshift` extension.
17
17
18
-
The container gets built inside the {openshift} cluster and is provided as an image stream.
18
+
The {openshift} cluster builds the container and provides it as an image stream.
19
19
20
-
Your Quarkus project includes pregenerated Dockerfiles with instructions.
21
-
When you want to use a custom Dockerfile, you must add the file in the `src/main/docker` directory or anywhere inside the module. Additionally, you must set the path to your Dockerfile by using the `quarkus.openshift.jvm-dockerfile` property.
20
+
If you want to use a custom Dockerfile, add the file to the `src/main/docker` directory or any location inside the module.
21
+
Additionally, set the path to your Dockerfile by using the `quarkus.openshift.jvm-dockerfile` property.
22
22
23
23
== Prerequisites
24
24
25
25
* You have OpenJDK {JDK-ver-all} installed.
26
26
* You have set the `JAVA_HOME` environment variable to the location of the Java SDK.
27
27
* You have Apache Maven {maven-version} installed.
28
28
* You have a Quarkus project that includes the `quarkus-openshift` extension.
29
-
* You have access to a {openshift} cluster and the latest compatible version of the `oc` tool installed.
29
+
* You have access to a {openshift} cluster and the latest compatible version of the `oc` CLI tool installed.
30
30
* You are working in the correct OpenShift project namespace.
31
31
32
32
== Procedure
@@ -37,33 +37,34 @@ When you want to use a custom Dockerfile, you must add the file in the `src/main
37
37
----
38
38
quarkus.openshift.build-strategy=docker
39
39
----
40
-
. Optional: Set the following properties in the `application.properties` file, as required by your environment:
41
-
.. If you are using an untrusted certificate, configure the `KubernetesClient`:
40
+
. Optional: Set the following properties in the `application.properties` file, based on your environment:
41
+
** If you are using an untrusted certificate, enable certificate trust for the `KubernetesClient`:
42
42
+
43
43
[source,properties]
44
44
----
45
45
quarkus.kubernetes-client.trust-certs=true
46
46
----
47
-
.. Expose the service to create an {openshift} route:
47
+
** To expose the service and create an {openshift} route, set the following property:
48
48
+
49
49
[source,properties]
50
50
----
51
51
quarkus.openshift.route.expose=true
52
52
----
53
-
.. Set the path to your custom Dockerfile:
53
+
** To use a custom Dockerfile instead of the pregenerated Dockerfiles, set the path to your Dockerfile:
. To retrieve the log output for your application's pod, use the `oc logs -f` command with the `<pod_name>` value of the pod you are interested in.
94
-
In this example, we use the `openshift-helloworld-1-gzzrx` pod name that corresponds with the latest pod prefixed with the name of your application:
93
+
. To get the log output for your application's pod, use the `oc logs -f` command with its name.
94
+
The following example uses the `openshift-helloworld-1-gzzrx` pod name, which corresponds to the latest pod prefixed with the name of your application:
To create an {openshift} route, ensure you have specified `quarkus.openshift.route.expose=true` in the `application.properties` file.
132
-
====
128
+
To do so, ensure you have exposed an {openshift} route by setting the `quarkus.openshift.route.expose=true` property in the `application.properties` file before building the application.
Be aware that the route is now listening on port 80 and no longer at port 8080.
143
+
Be aware that the route is now listening on port 80 and is no longer on port 8080.
148
144
====
149
145
+
150
146
You can test the application demonstrated in this example with a web browser or a terminal by using `curl` and the complete URL output from `oc get routes`, that is, "\http://openshift-helloworld-username-dev.apps.sandbox-m2.ll9k.p1.openshiftapps.com".
0 commit comments