Skip to content

Commit

Permalink
Quarkus super hero upgrade (#7389)
Browse files Browse the repository at this point in the history
* RHBQ 3.2 upgrade

* Remove the need for patching swagger ui

* Remove separate tasks for UI

* Update to use productized operators

* Cleanup

* Update for rhbq 3.2 branch

---------

Co-authored-by: Eric Deandrea <[email protected]>
  • Loading branch information
bbethell-1 and edeandrea authored Nov 17, 2023
1 parent 85c1efd commit 60119fb
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,20 @@ ocp4_workload_quarkus_super_heroes_demo_install_prometheus: true
ocp4_workload_quarkus_super_heroes_demo_install_grafana: false

ocp4_workload_quarkus_super_heroes_demo_temp_dir: /tmp/quarkus_superheroes
ocp4_workload_quarkus_super_heroes_demo_release_tag: rhbq-2.13
ocp4_workload_quarkus_super_heroes_demo_release_tag: rhbq-3.2
ocp4_workload_quarkus_super_heroes_demo_project_name: quarkus-superheroes

# yamllint disable-line rule:line-length
ocp4_workload_quarkus_super_heroes_demo_github_raw_url: "https://raw.githubusercontent.com/quarkusio/quarkus-super-heroes/{{ ocp4_workload_quarkus_super_heroes_demo_release_tag }}/deploy/k8s"

ocp4_workload_quarkus_super_heroes_demo_java_versions: [11, 17]
ocp4_workload_quarkus_super_heroes_demo_java_versions: [17]
ocp4_workload_quarkus_super_heroes_demo_native: native
ocp4_workload_quarkus_super_heroes_demo_service_project_names:
- "rest-villains"
- "rest-heroes"
- "rest-fights"
- "event-statistics"
- "ui-super-heroes"

ocp4_workload_quarkus_super_heroes_demo_infra_http_names:
- "prometheus-operated"
Expand All @@ -43,9 +44,8 @@ ocp4_workload_quarkus_super_heroes_demo_infra_https_names:
ocp4_workload_quarkus_super_heroes_demo_operator_names:
- "amq-streams"
- "container-security-operator"
- "jaeger"
- "opentelemetry-operator"
- "openshift-cert-manager-operator"
- "jaeger-product"
- "opentelemetry-product"

# yamllint disable-line rule:line-length
ocp4_workload_quarkus_super_heroes_demo_docs_link: "https://github.com/quarkusio/quarkus-super-heroes/tree/{{ ocp4_workload_quarkus_super_heroes_demo_release_tag }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
---
apiVersion: project.openshift.io/v1
kind: Project
metadata:
name: cert-manager-operator
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: cert-manager-operator-group
namespace: cert-manager-operator
spec:
targetNamespaces:
- "cert-manager-operator"
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: openshift-cert-manager-operator
namespace: openshift-operators
namespace: cert-manager-operator
spec:
channel: tech-preview
channel: stable-v1
installPlanApproval: Automatic
name: openshift-cert-manager-operator
source: redhat-operators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: container-security-operator
namespace: openshift-operators
spec:
channel: stable-3.8
channel: stable-3.9
installPlanApproval: Automatic
name: container-security-operator
source: redhat-operators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: jaeger
name: jaeger-product
namespace: openshift-operators
spec:
channel: stable
installPlanApproval: Automatic
name: jaeger
source: community-operators
name: jaeger-product
source: redhat-operators
sourceNamespace: openshift-marketplace
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: opentelemetry-operator
name: opentelemetry-product
namespace: openshift-operators
spec:
channel: alpha
channel: stable
installPlanApproval: Automatic
name: opentelemetry-operator
source: community-operators
name: opentelemetry-product
source: redhat-operators
sourceNamespace: openshift-marketplace

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
= ocp4-workload-quarkus-super-heroes-demo - Deploy Quarkus Superheroes Demo into OCP4

== Role overview
This role deploys the https://github.com/quarkusio/quarkus-super-heroes/tree/rhbq-2.7[Quarkus Superheroes Sample application], using Red Hat Build of Quarkus, to OCP4.
This role deploys the https://github.com/quarkusio/quarkus-super-heroes/tree/rhbq-3.2[Quarkus Superheroes Sample application], using Red Hat Build of Quarkus, to OCP4.

3 projects are created in the cluster:
2 projects are created in the cluster:

* `quarkus-superheroes-java11`
** Contains https://github.com/quarkusio/quarkus-super-heroes/blob/rhbq-2.13/deploy/k8s/java11-openshift.yml[JVM Java 11 version of the system]
* `quarkus-superheroes-java17`
** Contains https://github.com/quarkusio/quarkus-super-heroes/blob/rhbq-2.13/deploy/k8s/java17-openshift.yml[JVM Java 17 version of the system]
** Contains https://github.com/quarkusio/quarkus-super-heroes/blob/rhbq-3.2/deploy/k8s/java17-openshift.yml[JVM Java 17 version of the system]
* `quarkus-superheroes-native`
** Contains https://github.com/quarkusio/quarkus-super-heroes/blob/rhbq-2.13/deploy/k8s/native-openshift.yml[Native version of the system]
** Contains https://github.com/quarkusio/quarkus-super-heroes/blob/rhbq-3.2/deploy/k8s/native-openshift.yml[Native version of the system]

This role additionally deploys https://access.redhat.com/documentation/en-us/red_hat_amq_streams[Red Hat AMQ Streams]. A separate Kafka cluster is deployed into each project. The applications within each project are reconfigured to use the AMQ Streams cluster within its project.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,6 @@
# yamllint disable-line rule:line-length
src: "{{ ocp4_workload_quarkus_super_heroes_demo_temp_dir }}/{{ t_app_version }}-openshift.yml"

- name: "[{{ t_project_name }}] - Patch the app configs for Swagger UI"
kubernetes.core.k8s:
api_version: v1
kind: ConfigMap
name: "{{ t_app_name }}-config"
namespace: "{{ t_project_name }}"
state: patched
definition:
data:
quarkus.smallrye-openapi.servers: >-
http://{{ t_app_name }}-{{ t_project_name }}.{{ route_subdomain }}
loop:
- rest-fights
- rest-heroes
- rest-villains
loop_control:
loop_var: t_app_name

- name: "[{{ t_project_name }}] - Patch the app configs for Kafka"
kubernetes.core.k8s:
api_version: v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@
loop_control:
loop_var: t_app_name

- name: "[{{ t_project_name }}] - deploy Prometheus monitor for ui service"
vars:
t_metrics_path: "/metrics"
t_app_name: ui-super-heroes
kubernetes.core.k8s:
namespace: "{{ t_project_name }}"
state: present
# yamllint disable-line rule:line-length
definition: "{{ lookup('template', '../templates/prometheus_podmonitor.yaml.j2') | from_yaml_all | list }}"

- name: "[{{ t_project_name }}] - deploy Prometheus monitors for Kafka"
kubernetes.core.k8s:
namespace: "{{ t_project_name }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
OpenShift/Kubernetes API (use with oc login): {{ master_url }}
OpenShift Console URL: {{ console_url }}
There are 3 projects, each correlating to a version of the application as defined in {{ ocp4_workload_quarkus_super_heroes_demo_docs_link }}#versions:
There are 2 projects, each correlating to a version of the application as defined in {{ ocp4_workload_quarkus_super_heroes_demo_docs_link }}#versions:
- name: Output JVM project info
vars:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@
loop_control:
loop_var: t_operator_name

- name: Remove cert-manager operator
kubernetes.core.k8s:
api_version: project.openshift.io/v1
kind: Project
name: "{{ t_project_name }}"
state: absent
loop:
- cert-manager-operator
- cert-manager
loop_control:
loop_var: t_project_name

- name: Get cluster service versions
kubernetes.core.k8s_info:
api_version: operators.coreos.com/v1alpha1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@
loop_control:
loop_var: t_app_name

- name: "[{{ t_project_name }}] - Verify UI is running"
uri:
url: "http://ui-super-heroes-{{ t_project_name }}.{{ route_subdomain }}"
# yamllint disable-line rule:truthy
validate_certs: no
register: r_ui
until: r_ui.status == 200
retries: 50
delay: 10

- name: "[{{ t_project_name }}] - Verify http infra services are running"
uri:
url: "http://{{ t_infra_name }}-{{ t_project_name }}.{{ route_subdomain }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
kubernetes.core.k8s:
state: present
# yamllint disable-line rule:line-length
definition: "{{ lookup('file', '../files/cert_manager_subscription.yaml') | from_yaml }}"
definition: "{{ lookup('file', '../files/cert_manager_subscription.yaml') | from_yaml_all | list }}"

- name: Install AMQ Streams
include_tasks: install_amqstreams_operator.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Subscription
metadata:
name: grafana-operator
spec:
channel: v4
channel: v5
installPlanApproval: Automatic
name: grafana-operator
source: community-operators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ spec:
protocols:
grpc:
exporters:
jaeger:
endpoint: jaeger-collector-headless.{{ t_project_name }}.svc:14250
otlp/jaeger:
endpoint: jaeger-collector-headless.{{ t_project_name }}.svc:4317
tls:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt
insecure: true
processors:
batch:
extensions:
Expand All @@ -37,4 +37,4 @@ spec:
processors:
- batch
exporters:
- jaeger
- otlp/jaeger

0 comments on commit 60119fb

Please sign in to comment.