Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 6. Setting up applications for HawtIO Online
This section shows how to deploy a Camel Quarkus app on OpenShift and make it HawtIO-enabled with Camel Quarkus. Once deployed on OpenShift, it will be discovered by HawtIO Online.
- This project uses Quarkus Container Images and Kubernetes extensions to build a container image and deploy it to a Kubernetes/OpenShift cluster (pom.xml).
- The most important part in terms of the HawtIO-enabled configuration is defined in the - <properties>section. To make it HawtIO-enabled, the Jolokia agent must be attached to the application with HTTPS and SSL client-authentication configured. The client principal should match those that the HawtIO Online instance provides (the default is- hawtio-online.hawtio.svc).- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Running the application locally: - Run in development mode with: - mvn compile quarkus:dev - mvn compile quarkus:dev- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Or build the project and execute the runnable JAR: - mvn package && java -jar target/quarkus-app/quarkus-run.jar - mvn package && java -jar target/quarkus-app/quarkus-run.jar- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Running with the Jolokia agent locally: - You can run this example with Jolokia JVM agent locally as follows: - java -javaagent:target/quarkus-app/lib/main/org.jolokia.jolokia-agent-jvm-2.0.1-javaagent.jar -jar target/quarkus-app/quarkus-run.jar - java -javaagent:target/quarkus-app/lib/main/org.jolokia.jolokia-agent-jvm-2.0.1-javaagent.jar -jar target/quarkus-app/quarkus-run.jar- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Deploy it to OpenShift: - To deploy it to a cluster, firstly change the container image parameters in pom.xml to fit the development environment. (The default image name is - quay.io/hawtio/hawtio-online-example-camel-quarkus:latest, which should be pushed to the- hawtioorganisation on Quay.io.)- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Then build the project with option - -Dquarkus.container-image.push=trueto push the build image to the preferred container registry:- mvn install -Dquarkus.container-image.push=true - mvn install -Dquarkus.container-image.push=true- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- The resources file for deployment is also generated at target/kubernetes/kubernetes.yml. Use - kubectlor- occommand to deploy the application with the resources file:- kubectl apply -f target/kubernetes/kubernetes.yml - kubectl apply -f target/kubernetes/kubernetes.yml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- After deployment is successful and the pod has started, the application log can be seen on the cluster