Overview of HawtIO
HawtIO is a web-based console solution for monitoring and managing enterprise Red Hat HawtIO-enabled applications. The HawtIO operator is designed to simplify the installation, configuration, and management of HawtIO, a lightweight web console for managing and monitoring Java-based applications.
In this blog, we explore the HawtIO operator installation and deployment process on IBM Power. This can be very helpful for Apache Camel eco-system developers and administrators. Before you proceed, we recommend that you acquire familiarity with Apache Camel and IBM ppc64le architecture.
Setting up HawtIO operator on the IBM Power cluster
For setting up HawtIO on Red Hat OpenShift 4.x, you must install and deploy the HawtIO operator. The recommended mechanism for installation of operator is by using the HawtIO operator available on the OperatorHub.
- Log in to the Red Hat OpenShift console in the web browser as a user with cluster admin privileges.
- Click Operators > OperatorHub.
- On the OperatorHub page, in the search field, enter “HawtIO” to filter the list of operators. Click HawtIO Operator.
- On the HawtIO Operator installation window, click Install. The Create Operator Subscription form opens:
- From the Channel drop-down list, select stable-v1.
- From the Version drop-down list, select the required version.
- Click Install.
- From the Installed Namespace drop-down list, select the namespace in which you want to install the HawtIO Operator, and proceed further with installation.
- To verify that the operator is installed successfully, click Operators > Installed Operators. Notice that HawtIO is visible in the list of installed operators.
Configuring the HawtIO operator
Complete the following steps to configure and deploy the HawtIO operator on the IBM Power cluster:
- On the Installed Operators page, click the installed HawtIO operator.
- On the Details tab, in the Provided APIs section, click Create instance.
- You can opt to accept the default configurations or edit the options to meet your requirements.
Note: routeHostName has to be specified in the format, <name>. <namespace>. <cluster URL> to give customized name. If not specified, it is automatically generated in the format: <name>[-<namespace>].<suffix> where <suffix> is the default routing sub-domain as configured for the cluster. For example:
hawtio-application.my_namespace. https://console-openshift-console.apps.xxxxxxxxx.ibmp.psi.redhat.com
- Specify the deployment type while creating the instance.
Deployment could be one of the following types:
- Cluster: Select this option to monitor all namespaces on the OpenShift cluster for HawtIO-enabled applications.
- Namespace: Select this option to monitor only the HawtIO-enabled applications that have been deployed in the same namespace.
- After the instance is created, notice that the HawtIO Operator details page opens and displays the deployment status.
Accessing the HawtIO console
Perform the following steps to access the HawtIO console:
- In case of namespace deployment, open the project in which the HawtIO operator is installed. On the project Overview page, in the Launcher section, click HawtIO Console. For cluster deployment, in the OpenShift web console, click the HawtIO URL in the Launcher section.
- Log in to the HawtIO console. An authorize access page displays the HawtIO-enabled application pods that are authorized for access.
HawtIO online application setup
Now that we have completed the HawtIO operator installation and configuration, we are ready to deploy the HawtIO-enabled application, as an example. Let us see how to deploy a Apache Camel Quarkus application enabled for HawtIO on the OpenShift Power cluster.
In this example, we are using the Camel Quarkus application to build a container image and deploy it to OpenShift Container Platform cluster on IBM Power. Complete the following steps to enable an application for HawtIO.
- To make application HawtIO-enabled, the Jolokia agent must be attached to the application for remote monitoring and management of application with HTTPS and Secure Sockets Layer (SSL) client authentication configured. The client principal value should match with those that the HawtIO online instance provides (the default is hawtio-online.hawtio.svc). This must be defined in the pom.xml file in the <properties>
<properties>
<jolokia.protocol>https</jolokia.protocol>
<jolokia.host>*</jolokia.host>
<jolokia.port>8778</jolokia.port>
<jolokia.useSslClientAuthentication>true</jolokia.useSslClientAuthentication>
<jolokia.caCert>/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt</jolokia.caCert>
<jolokia.clientPrincipal.1>cn=hawtio-online.hawtio.svc</jolokia.clientPrincipal.1>
<jolokia.extendedClientCheck>true</jolokia.extendedClientCheck>
<jolokia.discoveryEnabled>false</jolokia.discoveryEnabled>
</properties>
- Use the following command to create a build and run the application locally in the development mode.
mvn compile quarkus:dev
- This build creates an application container image and pushes it to the registry for deployment. Now, configure the image registry, group, and tag in the pom.xml file:
<quarkus.container-image.registry>quay.io</quarkus.container-image.registry>
<quarkus.container-image.group>fuse_qe</quarkus.container-image.group>
<quarkus.container-image.tag>latest</quarkus.container-image.tag>
Or, you can use the registry available in the OpenShift cluster to push the build image.
- Build the project with the
-Dquarkus.container-image.push=true
option to push the build image to the preferred container registry using the following command:
mvn install -Dquarkus.container-image.push=true
- After the container image is pushed to the registry, you can update the YAML file if the cluster registry or some other image registry is being used. A YAML file is created for deployment at target/Kubernetes/Kubernetes.yml. Update the image tag in the Kubernetes.yml file with the required image name as shown in the following example:
image-registry.openshift-image-registry.svc:5000/namespace-name/hawtio-online-example-camel-quarkus-os@sha256:xxxxxxx.
- Use the resource file generated at target/kubernetes/kubernetes.yml for deployment. Use the
kubectl
command or the oc
command to deploy the application with the resources file.
kubectl apply -f target/kubernetes/kubernetes.yml
The following output is displayed:
[root@rhv-ppc64le-tps-4 camel-quarkus-openshift]# kubectl apply -f target/kubernetes/kubernetes.yml
deployment.apps/hawtio-online-example-camel-quarkus-os configured
Note: For deployment, use the same namespace that you used for installation and configuration of the HawtIO operator.
After the deployment is successful and the pod has started, the application log can be seen on the cluster.
- After the deployment is complete, use the launcher link present in respective project, to open the HawtIO online web console. All HawtIO-enabled applications are listed in the console as shown in the following screenshot.
- Click Connect on the HawtIO Containers console. This enables you to view and manage Apache Camel contexts, routes, and dependencies as shown in the following screenshot.
- You need to click the Camel contexts to view the list of contexts. In this example, click SampleCamel. Then, click Start or Suspend as per your requirement. To delete a context, click Suspend and then select the context from the drop-down list to delete it.
- To view a list of application attributes and values, click the Attributes tab. Click endpoints in the navigation pane and select the appropriate options to filter the list by URL, route ID, and direction.
- On the navigation pane, click Routes for the selected application to view the list of routes. On the routes page, select the checkbox next to a route and then click Start or Stop to perform the corresponding action. To delete a route, you must first stop it. Then click the ellipses button and select Delete from the drop-down menu. Refer to the detailed explanation of debugging routes in Red Hat documentation.
Summary
The HawtIO operator is a powerful tool to streamline application management and monitor workflows on IBM Power. It can help you to stay ahead of the curve.