liveBook · Manning

Quarkus-openshift

As explained in Quarkus in Action

OpenShift integration is a Quarkus extension capability that supports deploying applications and generated resources to OpenShift.

The quarkus-openshift extension generates and deploys OpenShift resources for a Quarkus application, avoiding long, error-prone YAML. It provides an OpenShift-specific alternative to quarkus-kubernetes and also participates in container image building. section 11.3.4 section 11.3.1

Use the extension to:

  • Replace the Kubernetes extension with quarkus-openshift. section 11.3.4
  • Generate openshift.yml and openshift.json alongside Kubernetes resource files in target/kubernetes or build/kubernetes. section 11.3.4 section 11.3.1
  • Customize datasource variables, monitoring resources, and route exposure with quarkus.openshift properties. section 11.3.4
  • Apply the generated resources with oc apply -f inventory-service/target/kubernetes/openshift.yml. section 11.3.4

Generated OpenShift deployment

A generated manifest can contain a Service, ImageStreams for base and application images, a BuildConfig, and a Deployment. Configure quarkus.openshift.route.expose=true to expose the service, then inspect readiness with oc get pods and the public endpoint with oc get routes. section 11.3.4

$ quarkus ext remove kubernetes
Looking for the newly published extensions in registry.quarkus.io
[SUCCESS] ✅  Extension io.quarkus:quarkus-kubernetes has been uninstalled
$ quarkus ext add openshift
[SUCCESS] ✅  Extension io.quarkus:quarkus-openshift has been installed

Shows the extension commands for removing quarkus-kubernetes and adding quarkus-openshift. section 11.3.4

# Remove the Kubernetes configuration from the previous section
-quarkus.kubernetes.env.vars.quarkus-datasource-jdbc-url=
jdbc:mysql://mysql:3306/inventory
-quarkus.kubernetes.prometheus.generate-service-monitor=false
-quarkus.kubernetes.namespace=default

quarkus.openshift.env.vars.quarkus-datasource-jdbc-url=
jdbc:mysql://mysql:3306/inventory

quarkus.openshift.prometheus.generate-service-monitor=false

# Expose created service to the world
quarkus.openshift.route.expose=true

Shows OpenShift-specific configuration for datasource variables, monitoring, and route exposure. section 11.3.4

How Quarkus in Action covers it

How deep it goes
Explains installation, generated resources, configuration, application, and deployment checks, but not OpenShift internals.
Examples
Uses an Inventory service with MySQL, generated YAML, ImageStreams, BuildConfig, routes, and oc inspection commands.
What it assumes
Assumes an OpenShift environment and locally available oc executable, while deriving deployment resources from a Quarkus application.
What you can do after
Operate/configure an OpenShift deployment by generating, customizing, applying, and inspecting Quarkus resources.
How it connects
Connects Kubernetes manifests, container images, ImageStreams, BuildConfig, Deployment, Service, and routes.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.