Deploying your Red Hat build of Quarkus applications to OpenShift Container Platform Red Hat build of Quarkus 3.8 Red Hat Customer Content Services

Commands:
<dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-openshift</artifactId> </dependency>
./mvnw quarkus:add-extension -Dextensions="io.quarkus:quarkus-openshift"
quarkus extension add 'quarkus-openshift'
login
project -q
project <project_name>
new-project <project_name>
quarkus.openshift.build-strategy=docker
quarkus.kubernetes-client.trust-certs=true
quarkus.openshift.route.expose=true
quarkus.openshift.jvm-dockerfile=<path_to_your_dockerfile>
quarkus.openshift.jvm-dockerfile=src/main/resources/Dockerfile.custom-jvm
./mvnw clean package -Dquarkus.openshift.deploy=true
get pods
NAME READY STATUS RESTARTS AGE openshift-helloworld-1-build 0/1 Completed 0 11m openshift-helloworld-1-deploy 0/1 Completed 0 10m openshift-helloworld-1-gzzrx 1/1 Running 0 10m
logs -f openshift-helloworld-1-gzzrx
Starting the Java application using /opt/jboss/container/java/run/run-java.sh INFO exec -a "java" java -Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -XX:MaxRAMPercentage=50.0 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:+ExitOnOutOfMemoryError -cp "." -jar /deployments/quarkus-run.jar __ ____ __ _____ ___ __ ____ ______ --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ --\___\_\____/_/ |_/_/|_/_/|_|\____/___/ 2024-06-27 17:13:25,254 INFO [io.quarkus] (main) getting-started 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.8.6.SP3-redhat-00002) started in 0.653s. Listening on: http://0.0.0.0:8080 2024-06-27 17:13:25,281 INFO [io.quarkus] (main) Profile prod activated. 2024-06-27 17:13:25,281 INFO [io.quarkus] (main) Installed features: [cdi, kubernetes, resteasy-reactive, smallrye-context-propagation, vertx]
get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE openshift-helloworld ClusterIP 172.30.64.57 <none> 80/TCP 14m
get routes
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD openshift-helloworld openshift-helloworld-username-dev.apps.sandbox-m2.ll9k.p1.openshiftapps.com openshift-helloworld http None
quarkus.openshift.build-strategy=docker
quarkus.native.container-build=true
quarkus.kubernetes-client.trust-certs=true
quarkus.openshift.route.expose=true
quarkus.openshift.native-dockerfile=<path_to_your_dockerfile>
quarkus.openshift.jvm-dockerfile=src/main/docker/Dockerfile.custom-native
quarkus.native.container-runtime=podman
quarkus.native.container-runtime=docker
./mvnw clean package -Pnative -Dquarkus.openshift.deploy=true
get is 1 get pods 2 get svc 3
logs -f <pod_name>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.target>17</maven.compiler.target>
./mvnw clean package
MAVEN_S2I_ARTIFACT_DIRS=target/quarkus-app S2I_SOURCE_DEPLOYMENTS_FILTER=app lib quarkus quarkus-run.jar JAVA_OPTIONS=-Dquarkus.http.host=0.0.0.0 AB_JOLOKIA_OFF=true JAVA_APP_JAR=/deployments/quarkus-run.jar
import-image ubi8/openjdk-17 --from=registry.access.redhat.com/ubi8/openjdk-17 --confirm
new-app registry.access.redhat.com/ubi8/openjdk-17~<git_path> --name=<project_name>
start-build <project_name>
expose svc <project_name>
get pods
logs -f <pod_name>
<maven.compiler.source>21</maven.compiler.source> <maven.compiler.target>21</maven.compiler.target>
./mvnw clean package
MAVEN_S2I_ARTIFACT_DIRS=target/quarkus-app S2I_SOURCE_DEPLOYMENTS_FILTER=app lib quarkus quarkus-run.jar JAVA_OPTIONS=-Dquarkus.http.host=0.0.0.0 AB_JOLOKIA_OFF=true JAVA_APP_JAR=/deployments/quarkus-run.jar
import-image ubi8/openjdk-21 --from=registry.access.redhat.com/ubi8/openjdk-21 --confirm
new-app registry.access.redhat.com/ubi8/openjdk-21~<git_path> --name=<project_name>
start-build <project_name>
expose svc <project_name>
get pods
logs -f <pod_name>