Super Heroes on OpenShift Workshop
  • Super Heroes on OpenShift Workshop
    • About Workshop
    • Application Architecture
    • Getting Started
  • Application Services Deployment
    • Databases Deployment
      • Deploy Database For Hero Microservice
      • Deploy Database For Villain Microservice
      • Deploy Database For Fight Microservice
    • AMQ Streams (Kafka) Deployment
    • Service Registry (Apicurio) Deployment
  • Application Deployment
    • Microservices Deployment
      • Hero Microservice
      • Villain Microservice
      • Fight Microservice
      • Super Hero UI Microservice
      • Statistics and UI Microservices
      • Beautify The Topology View
  • Continuous Deployment (CD)
    • GitOps
  • Application Monitoring
    • Application Metrics
      • Configure Service Monitoring
      • Query Application Metrics
    • Distributed Tracing
      • Configure OpenShift Distributed Tracing Platform
      • Configure OpenShift Distributed Tracing Data Collection
      • Trace Application Transaction
  • Appendix
    • What's Quarkus?
    • Useful Resources
Powered by GitBook
On this page
  • Deploy application using Quarkus Maven plugin
  • What have you learnt?
  1. Application Deployment
  2. Microservices Deployment

Fight Microservice

PreviousVillain MicroserviceNextSuper Hero UI Microservice

Last updated 2 years ago

Deploy application using Quarkus Maven plugin

  1. Open the Web Terminal. Then run this command to clone Git repository to local.

    git clone http://git.gitea.svc.cluster.local:3000/lab-user/developer-advocacy-2022.git

    Notice that the URL is internal DNS! Yes, there is a Git server (Gitea) running in the same cluster but different project.

  2. Run this command to go into the Fight microservice project directory.

    cd developer-advocacy-2022/code/rest-fights && ls -l
  3. Run this command to build and deploy microservice to OpenShift cluster.

     ./mvnw -s maven-setting.xml install \
     -DskipTests \
     -Dquarkus.container-image.group=$(oc project --short) \
     -Dquarkus.profile=openshift-17 \
     -Dquarkus.kubernetes.deploy=true

    Yes!, you don't have to write Dockerfile, build container image, push the image to container registry e.g. Docker Hub, Quay.io, then deploy the container image to OpenShift cluster step by step. With one command you can get all of these done! Thank you Quarkus ecosystem

  4. Wait until the build success. Then go to Builds menu, you should see a new rest-fights BuildConfigs for OpenShift Build (Binary).

    What happens behind the scene is that when you run Maven build in local, Quarkus Maven plugin (plus a bunch of configurations) talks to OpenShift to create required resources for your service i.e. ConfigMap, Secret, Deployment etc. including the BuildConfigs as well. When code build in local is done, the plugin will upload artefacts a.k.a binaries e.g. jar, war, libraries to OpenShift and after that the OpenShift Build kicks off the container image build and deploy.

    Click on the rest-fights BuildConfigs to see build logs.

  5. Go to Builds tab, you should see the build task.

  6. Now go back to Topology menu. You'll be more surprised. The microservice has been deployed as well as visual connectors (arrow lines) by just using Maven command. This is the magic of Quarkus!

What have you learnt?

  1. How to deploy microservice using Maven command.

  2. How to check OpenShift Build logs.

Magic of Quarkus framework! (well, you didn't learn anything but you saw it, right? )

😆
🙏
Deploy application
Deploy application
Deploy application
Deploy application
Deploy application