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
