-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Docs: Create procedure for Deploying on OpenShift using Docker build strategy #45918
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request! Your pull request does not follow our editorial rules. Could you have a look?
This message is automatically generated by a bot. |
ea3166e
to
d431deb
Compare
d431deb
to
54134b5
Compare
Signed-off-by: shjones <[email protected]>
Signed-off-by: shjones <[email protected]>
Signed-off-by: shjones <[email protected]>
54134b5
to
b87770d
Compare
Status for workflow
|
🎊 PR Preview 17b634f has been successfully built and deployed to https://quarkus-pr-main-45918-preview.surge.sh/version/main/guides/
|
Hi @iocanel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed some items to bullet points to better reflect that they are a collection of independent options rather than a sequence of steps. Additionally, to make it clearer that these options are optional, I replaced the imperative verb form with the infinitive "To ..." form. Feel free to apply this approach to any other PRs that include similar lists of optional steps.
As an application developer, you can deploy your applications to {openshift} by using the Docker build strategy as a deployment option. | ||
This functionality is provided by the `quarkus-openshift` extension. | ||
|
||
The container gets built inside the {openshift} cluster and is provided as an image stream. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The container gets built inside the {openshift} cluster and is provided as an image stream. | |
The {openshift} cluster builds the container and provides it as an image stream. |
The container gets built inside the {openshift} cluster and is provided as an image stream. | ||
|
||
Your Quarkus project includes pregenerated Dockerfiles with instructions. | ||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. | |
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.jvm-dockerfile` property. |
* You have set the `JAVA_HOME` environment variable to the location of the Java SDK. | ||
* You have Apache Maven {maven-version} installed. | ||
* You have a Quarkus project that includes the `quarkus-openshift` extension. | ||
* You have access to a {openshift} cluster and the latest compatible version of the `oc` tool installed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* You have access to a {openshift} cluster and the latest compatible version of the `oc` tool installed. | |
* You have access to a {openshift} cluster and the latest compatible version of the `oc` CLI tool installed. |
---- | ||
quarkus.openshift.build-strategy=docker | ||
---- | ||
. Optional: Set the following properties in the `application.properties` file, as required by your environment: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. Optional: Set the following properties in the `application.properties` file, as required by your environment: | |
. Optional: Set the following properties in the `application.properties` file based on your environment: |
quarkus.openshift.build-strategy=docker | ||
---- | ||
. 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`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. If you are using an untrusted certificate, configure the `KubernetesClient`: | |
** If you are using an untrusted certificate, enable certificate trust for the `KubernetesClient`: |
---- | ||
quarkus.kubernetes-client.trust-certs=true | ||
---- | ||
.. Expose the service to create an {openshift} route: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. Expose the service to create an {openshift} route: | |
** To expose the service and create an {openshift} route, set the following property: |
---- | ||
quarkus.openshift.route.expose=true | ||
---- | ||
.. Set the path to your custom Dockerfile: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. Set the path to your custom Dockerfile: | |
** To use a custom Dockerfile instead of the pregenerated Dockerfiles, set the path to your Dockerfile: |
quarkus.openshift.jvm-dockerfile=<path_to_your_dockerfile> | ||
---- | ||
The following example shows the path to the `Dockerfile.custom-jvm`: | ||
+ | ||
[source,properties] | ||
---- | ||
quarkus.openshift.jvm-dockerfile=src/main/resources/Dockerfile.custom-jvm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quarkus.openshift.jvm-dockerfile=<path_to_your_dockerfile> | |
---- | |
The following example shows the path to the `Dockerfile.custom-jvm`: | |
+ | |
[source,properties] | |
---- | |
quarkus.openshift.jvm-dockerfile=src/main/resources/Dockerfile.custom-jvm | |
quarkus.openshift.jvm-dockerfile=<path_to_your_dockerfile> | |
---- | |
+ | |
.Example path to the `Dockerfile.custom-jvm` | |
[source,properties] | |
---- | |
quarkus.openshift.jvm-dockerfile=src/main/resources/Dockerfile.custom-jvm |
Or maybe use:
For example, to specify a custom Dockerfile named `Dockerfile.custom-jvm`:
They key thing is to use the +
so the example indent and aligns with the bullet point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Sheila,
Great work! With your agreement, I’ve taken the opportunity to provide a more thorough review. I hope you find it helpful. Feel free to apply or disregard any suggestions as you see fit.
Thanks!
quarkus.openshift.jvm-dockerfile=src/main/resources/Dockerfile.custom-jvm | ||
---- | ||
|
||
. Package and deploy your application to the current OpenShift project: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. Package and deploy your application to the current OpenShift project: | |
. Package and deploy your application to the current {openshift} project: |
|
||
== Verification | ||
|
||
The verification steps and related terminal outputs are demonstrated on the `openshift-helloworld` example application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The verification steps and related terminal outputs are demonstrated on the `openshift-helloworld` example application. | |
The following verification steps use the `openshift-helloworld` example application. |
Where is this example located? Should we provide a link for clarity? I couldn’t find it in Quarkus Quickstarts...
. 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. | ||
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. 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. | |
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: | |
. To get the log output for your application's pod, use the `oc logs -f` command with its name. For example: |
oc logs -f _openshift-helloworld-1-gzzrx_ | ||
---- | ||
+ | ||
[source,shell,subs=attributes+] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[source,shell,subs=attributes+] | |
.Example output | |
[source,shell,subs=attributes+] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure whether we want to label outputs, but if we do, we should aim to apply it consistently across all upstream-downstream documentation. Something to think about for the future.
2024-09-17 10:23:25,281 INFO [io.quarkus] (main) Installed features: [cdi, kubernetes, rest, smallrye-context-propagation, vertx] | ||
---- | ||
|
||
. Retrieve a list of services: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. Retrieve a list of services: | |
. To get a list of services: |
. Get a URL to test your application. | ||
+ | ||
[NOTE] | ||
==== | ||
To create an {openshift} route, ensure you have specified `quarkus.openshift.route.expose=true` in the `application.properties` file. | ||
==== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. Get a URL to test your application. | |
+ | |
[NOTE] | |
==== | |
To create an {openshift} route, ensure you have specified `quarkus.openshift.route.expose=true` in the `application.properties` file. | |
==== | |
. If you exposed an {openshift} route by setting the `quarkus.openshift.route.expose=true` property before building the application, you can get a URL to test it: |
+ | ||
[NOTE] | ||
==== | ||
Be aware that the route is now listening on port 80 and no longer at port 8080. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd double-check with the SME correctness of the current statement. Is the route is listening on port 80 in addition to port 8080? If so, maybe:
Be aware that the route is now listening on port 80 and no longer at port 8080. | |
Be aware that the route is now listening on port 80. |
This PR aims to draft a procedure for the following use case
Reference: Based on the Red Hat build of Quarkus guide Deploying on OpenShift Container Platform