Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Develop and test a Quarkus client on Red Hat CodeReady Containers with Red Hat Data Grid 8.0

June 19, 2020
Durgesh Anaokar
Related topics:
JavaArtificial intelligenceKubernetesQuarkus

    This article is about my experience installing Red Hat Data Grid (RHDG) on Red Hat CodeReady Containers (CRC) so that I could set up a local environment to develop and test a Quarkus Infinispan client. I started by installing CodeReady Containers and then installed Red Hat Data Grid. I am also on a learning path for Quarkus, so my last step was to integrate the Quarkus Infinispan client into my new development environment.

    Initially, I tried connecting the Quarkus client to my locally running instance of Data Grid. Later, I decided I wanted to create an environment where I could test and debug Data Grid on Red Hat OpenShift 4. I tried installing Data Grid on OpenShift 4 in a shared environment, but maintaining that environment was challenging. Through trial-and-error, I found that it was better to install Red Hat Data Grid on CodeReady Containers and use that for my local development and testing environment.

    In this quick tutorial, I guide you through setting up a local environment to develop and test a Quarkus client—in this case, Quarkus Infinispan. The process consists of three steps:

    1. Install and run CodeReady Containers.
    2. Install Data Grid on CodeReady Containers.
    3. Integrate the Quarkus Infinispan client into the new development environment.

    Step 1: Install and run CodeReady Containers

    To start, download the current version of CodeReady Containers. If you need installation instructions, see this guide from the CodeReady Containers development team.

    After I installed CodeReady Containers, I ran the following command to set it up and start it in the same sequence:

    # crc setup
    # crc start
    

    Starting your CRC installation automatically starts OpenShift. You can check the logs at https://api.crc.testing:6443 to confirm that OpenShift is running. In the logs, you will also see the following login details:

    [INFO]"To access the cluster, first set up your environment by following 'crc oc-env' instructions"
    [INFO]"Then you can access it by running 'oc login -u developer -p developer https://api.crc.testing:6443'"
    [INFO]"To login as an admin, run 'oc login -u kubeadmin -p 8rynV-SeYLc-h8Ij7-YPYcz https://api.crc.testing:6443'"
    

    That's it for the first step.

    Step 2: Install Red Hat Data Grid on CodeReady Containers

    Next, you want to install the Data Grid Operator on Red Hat OpenShift Container Platform (OCP). You can use either the command-line interface (CLI) or the OCP user interface (UI). I chose to use the UI for my installation. Here are the installation steps:

    1. Log in to the OCP console, as shown in Figure 1.
      A screenshot of the login dialog for OCP.
      Figure 1. Log in to the OpenShift Container Platform console.
    2. Create a project to install the Data Grid Operator, as shown in Figure 2.
      A screenshot of the OCP project dialog.
      Figure 2. Create a project to install the Data Grid Operator.
    3. Create an instance of the Data Grid Operator. Doing this also creates the Data Grid pod, as shown in Figure 3.
      A screenshot of the dialog to create an instance of the Data Grid Operator.
      Figure 3. Create an instance of the Data Grid Operator
    4. Check the running pods on OCP:
      $ oc get pods
      NAME                                    READY   STATUS      RESTARTS   AGE
      example-infinispan-0                    1/1     Running     0          6d4h
      infinispan-operator-77cd666d7d-xjqcj    1/1     Running     0          6d4h
      

    Gather information for your next installation

    After you confirm that Data Grid is installed, take note of the service IP for the Data Grid service. You will need this information when you install the Quarkus Infinispan client.

    $ oc get svc
    NAME                           TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)     AGE
    example-infinispan             ClusterIP   172.30.51.239   <none>        11222/TCP   6d4h
    

    Next, check the user ID for Data Grid and the clustered-openshift.xml:

    $ oc rsh example-infinispan-0
    sh-4.4$ cat /opt/infinispan/server/conf/users.properties
    #$REALM_NAME=default$
    #Tue Jun 09 03:58:58 GMT 2020
    developer=RSRKP8snxVdCbQP3
    operator=brw2JVxLQw1gsF4M
    

    Finally, check the configuration files details for your sasl-mechanism:

    $ oc rsh example-infinispan-0
    sh-4.4$ cat /opt/infinispan/server/conf/infinispan.xml
    

    Figure 4 shows the correct output:

    A screenshot of the output.
    Figure 4. The output from a successful Red Hat Data Grid installation.

    Install and run the Quarkus Infinispan client

    Finally, you can install and run the Quarkus Infinispan client.

    1. Download the client from Quarkus.io, as shown in Figure 5.
      A screenshot of the download page on Quarkus.io.
      Figure 5. Download the Quarkus Infinispan client from Quarkus.io.
    2. Once you have Quarkus Infinispan, extract the client code. Test the code against your local Data Grid instance to ensure that it is working.
    3. Assuming the code works, add the following values to the Infinispan client's application.properties file (see the pod/service directory for these values):
      # The IP should be CLUSTER-IP shown by oc get svc for RHDG deployment
      Quarkus.infinispan-client.server-list=172.30.51.239:11222
      
      #The following would be the authentication details for the RHDG installed
      Quarkus.infinispan-client.auth-username=developer
      Quarkus.infinispan-client.auth-password=RSRKP8snxVdCbQP3
      Quarkus.infinispan-client.use-auth=true
      Quarkus.infinispan-client.sasl-mechanism=DIGEST-MD5 #you can choose the sasl machenism and set it here
      Quarkus.kubernetes-client.trust-certs=true
      Quarkus.infinispan-client.client-intelligence=BASIC
      
      #The following properties are required to push the build to OCP
      Quarkus.openshift.expose=true
      Quarkus.kubernetes.deployment-target=openshift
      Quarkus.s2i.base-jvm-image=registry.access.redhat.com/openjdk/openjdk-11-rhel7
      
    4. After you have updated the application.properties file, run this command at the project's base directory:
      ./mvnw clean package -DQuarkus.kubernetes.deploy=true
      

      The application will be deployed to CodeReady Containers, and you should see the following logs:

      [INFO] [io.Quarkus.kubernetes.deployment.KubernetesDeployer] Deploying to openshift server: https://api.crc.testing:6443/ in namespace: testrhdg.
      [INFO] [io.Quarkus.kubernetes.deployment.KubernetesDeployer] Applied: ServiceAccount infinispan-client-quickstart.
      [INFO] [io.Quarkus.kubernetes.deployment.KubernetesDeployer] Applied: Service infinispan-client-quickstart.
      [INFO] [io.Quarkus.kubernetes.deployment.KubernetesDeployer] Applied: ImageStream infinispan-client-quickstart.
      [INFO] [io.Quarkus.kubernetes.deployment.KubernetesDeployer] Applied: ImageStream openjdk-11-rhel7.
      [INFO] [io.Quarkus.kubernetes.deployment.KubernetesDeployer] Applied: BuildConfig infinispan-client-quickstart.
      [INFO] [io.Quarkus.kubernetes.deployment.KubernetesDeployer] Applied: DeploymentConfig infinispan-client-quickstart.
      [INFO] [io.Quarkus.kubernetes.deployment.KubernetesDeployer] Applied: Route infinispan-client-quickstart.
      [INFO] [io.Quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 120321ms
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  02:06 min
      [INFO] Finished at: 2020-06-10T07:04:53+05:30
      [INFO] ------------------------------------------------------------------------
      

    Check your installation

    You can run additional checks to ensure that the Infinispan client is running in your development environment. First, check the new pods that were created with the Quarkus Infinispan build:

    $ oc get pods
    NAME                                    READY   STATUS      RESTARTS   AGE
    example-infinispan-0                    1/1     Running     0          6d22h
    infinispan-client-quickstart-1-build    0/1     Completed   0          2m50s
    infinispan-client-quickstart-1-deploy   0/1     Completed   0          72s
    infinispan-client-quickstart-1-hlwg6    1/1     Running     0          66s
    infinispan-operator-77cd666d7d-xjqcj    1/1     Running     0          6d22h
    

    Second, check the route for the newly deployed service and access it:

    $ oc get routes
    NAME                           HOST/PORT                                                PATH   SERVICES                       PORT    TERMINATION   WILDCARD
    infinispan-client-quickstart   infinispan-client-quickstart-testrhdg.apps-crc.testing   /      infinispan-client-quickstart   8081                  None
    

    Now you can access the client in any web browser at http://infinispan-client-quickstart-testrhdg.apps-crc.testing/infinispan, or on the command line, and play with it. As an example, you could add more interfaces to the client code, which would allow you to perform different operations with Red Hat Data Grid.

    Conclusion

    In this article, I showed you what I did to create a client for Infinispan with the help of Quarkus. I also showed you how to run the client on OpenShift 4.x for an installed Red Hat Data Grid 8.0 instance. There might be a more sophisticated way to implement the same solution or find values from the OpenShift cluster. I hope sharing my experience will be helpful to others.

    Download the source code for these examples from my Infinispan Client Quickstart on GitHub.

    Last updated: June 25, 2020

    Recent Posts

    • MCP servers vs. skills: Choosing the right context for your AI

    • How to route external and local LLMs with Models-as-a-Service

    • Protect data offloaded to GPU-accelerated environments with OpenShift sandboxed containers

    • Case study: Measuring energy efficiency on the x64 platform

    • How to prevent AI inference stack silent failures

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.