Skip to content

Commit

Permalink
QDOCS-1083: implemented peer review fixes
Browse files Browse the repository at this point in the history
Signed-off-by: shjones <[email protected]>
  • Loading branch information
sheilamjones committed Feb 8, 2025
1 parent c2d9f27 commit c64a8b9
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions docs/src/main/asciidoc/deploying-to-openshift-native-howto.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ You must create a native executable for your application that targets the Linux
If your host operating system is different from this, create a native Linux executable by using a container runtime, for example, Docker or Podman.

Your Quarkus project includes pregenerated Dockerfiles with instructions.
To use a custom Dockerfile, add the file in the `src/main/docker` directory or anywhere inside the module, and set the path to your Dockerfile by using the `quarkus.openshift.native-dockerfile` property.
If you want to use a custom Dockerfile, add the file to the `src/main/docker` directory or any location inside the module.
Additionally, set the path to your Dockerfile by using the `quarkus.openshift.native-dockerfile` property.

== Prerequisites

* You have a Linux AMD64 system or an Open Container Initiative (OCI) compatible container runtime, such as Podman or Docker.
* You have a Quarkus Maven project that includes the `quarkus-openshift` extension.
* You are working in the correct OpenShift project namespace.
* You are working in the correct {openshift} project namespace.

== Procedure

Expand All @@ -35,52 +36,53 @@ To use a custom Dockerfile, add the file in the `src/main/docker` directory or a
----
quarkus.openshift.build-strategy=docker
----
. Set the container runtime:
. Enable container-based native builds:
+
[source,properties]
----
quarkus.native.container-build=true
----
. Optional: Set the following properties in the `application.properties` file, as required by your environment:
.. If you are using an untrusted certificate, configure the `KubernetesClient` property:
. Optional: Set the following properties in the `application.properties` file based on your environment:
** If you are using an untrusted certificate, enable certificate trust for the `KubernetesClient`:
+
[source,properties]
----
quarkus.kubernetes-client.trust-certs=true
----
.. Expose the service to create an {openshift} route:
** To expose the service and create an {openshift} route, set the following property:
+
[source,properties]
----
quarkus.openshift.route.expose=true
----
.. Set the path to your custom Dockerfile:
** To use a custom Dockerfile instead of the pregenerated Dockerfiles, set the path to your custom Dockerfile:
+
[source,properties,subs="attributes+,+quotes"]
----
quarkus.openshift.native-dockerfile=<path_to_your_dockerfile>
----
The following example shows the path to the `Dockerfile.custom-native`:
For example, to specify a custom Dockerfile named `Dockerfile.custom-native`:
+
[source,properties]
----
quarkus.openshift.jvm-dockerfile=src/main/docker/Dockerfile.custom-native
quarkus.openshift.native-dockerfile=src/main/docker/Dockerfile.custom-native
----
.. Specify the container engine:
** To build a native executable with Podman:

** Specify the container engine:
*** To build a native executable with Podman:
+
[source,properties]
----
quarkus.native.container-runtime=podman
----
** To build a native executable with Docker:
*** To build a native executable with Docker:
+
[source,properties]
----
quarkus.native.container-runtime=docker
----

. Finally, build a native executable, package, and deploy your application to {openshift}:
. Finally, build the native executable, package, and deploy your application to {openshift}:
+
[source,shell,subs="attributes+,+quotes"]
----
Expand All @@ -89,8 +91,8 @@ quarkus.native.container-runtime=docker

== Verification

. Verify that an image stream and a service resource is created and the application is deployed by using the OpenShift web console.
Alternatively, you can run the following {openshift} command-line interface (CLI) commands:
. Verify that an image stream and a service resource are created, and that the application is deployed.
Use the {openshift} web console or the following {openshift} command-line interface (CLI) commands:
+
[source,shell,subs="attributes+,+quotes"]
----
Expand All @@ -99,11 +101,11 @@ oc get pods <2>
oc get svc <3>
----
<1> List the image streams created.
<2> View a list of pods associated with your current OpenShift project.
<3> Get the list of Kubernetes services.
<2> List the pods associated with your current OpenShift project.
<3> List the Kubernetes services.

[start=2]
. To retrieve the log output for your application's pod, enter the following command where `__<pod_name>__` is the name of the latest pod prefixed with the name of your application:
. To get the log output for your application's pod, run the following command where `__<pod_name>__` is the name of the latest pod prefixed with the name of your application:
+
[source,shell,subs="attributes+,+quotes"]
----
Expand Down

0 comments on commit c64a8b9

Please sign in to comment.