From 437b2a77ef764836568dfe8348582dd1cc85356e Mon Sep 17 00:00:00 2001 From: kusuma chalasani Date: Fri, 27 Feb 2026 18:53:24 +0530 Subject: [PATCH 1/4] Use load with in tfb container Signed-off-by: kusuma chalasani --- .../manifests/kruize-runtimes/postgres.yaml | 59 ++++++++++++ .../quarkus-resteasy-hibernate.yaml | 89 +++++++++++++++++++ .../kruize-runtimes/service-monitor.yaml | 13 +++ 3 files changed, 161 insertions(+) create mode 100644 techempower/manifests/kruize-runtimes/postgres.yaml create mode 100644 techempower/manifests/kruize-runtimes/quarkus-resteasy-hibernate.yaml create mode 100644 techempower/manifests/kruize-runtimes/service-monitor.yaml diff --git a/techempower/manifests/kruize-runtimes/postgres.yaml b/techempower/manifests/kruize-runtimes/postgres.yaml new file mode 100644 index 00000000..4e8a48fd --- /dev/null +++ b/techempower/manifests/kruize-runtimes/postgres.yaml @@ -0,0 +1,59 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: tfb-database + labels: + app: tfb-database +spec: + replicas: 1 + selector: + matchLabels: + app: tfb-database + template: + metadata: + labels: + name: tfb-database + app: tfb-database + # Add label to the application which is used by kruize/autotune to monitor it + app.kubernetes.io/name: "tfb-database" + version: v1 + spec: + containers: + - name: tfb-database + image: quay.io/kruizehub/tfb-postgres:openshift + imagePullPolicy: IfNotPresent + env: + - name: POSTGRESQL_USER + value: benchmarkdbuser + - name: POSTGRESQL_PASSWORD + value: benchmarkdbpass + - name: POSTGRESQL_DATABASE + value: hello_world + lifecycle: + postStart: + exec: + command: ["/bin/sh", "-c", "sleep 10 && psql -a hello_world < /tmp/create-postgres-data.sql"] + ports: + - containerPort: 5432 + resources: + requests: + cpu: 2 + memory: "1024Mi" + limits: + cpu: 2 + memory: "1024Mi" +--- +apiVersion: v1 +kind: Service +metadata: + name: tfb-database + labels: + name: tfb-database +spec: + type: ClusterIP + selector: + app: tfb-database + ports: + - protocol: TCP + port: 5432 + targetPort: 5432 diff --git a/techempower/manifests/kruize-runtimes/quarkus-resteasy-hibernate.yaml b/techempower/manifests/kruize-runtimes/quarkus-resteasy-hibernate.yaml new file mode 100644 index 00000000..f2889fdd --- /dev/null +++ b/techempower/manifests/kruize-runtimes/quarkus-resteasy-hibernate.yaml @@ -0,0 +1,89 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: tfb-qrh-sample + labels: + app: tfb-qrh-app +spec: + replicas: 1 + selector: + matchLabels: + app: tfb-qrh-deployment + template: + metadata: + labels: + name: tfb-qrh-deployment + app: tfb-qrh-deployment + # Add label to the application which is used by kruize/autotune to monitor it + app.kubernetes.io/name: "tfb-qrh-deployment" + app.kubernetes.io/layer: "quarkus" + version: v1 + spec: + volumes: + - name: test-volume + containers: + - name: tfb-server + image: quay.io/kruizehub/tfb-qrh:1.13.2.F_et17 + imagePullPolicy: IfNotPresent + env: + - name: "JAVA_OPTIONS" + value: "-server" + ports: + - containerPort: 8080 + resources: + requests: + cpu: 0.5 + memory: "512Mi" + limits: + cpu: 3.5 + memory: "2048Mi" + volumeMounts: + - name: "test-volume" + mountPath: "/opt/jLogs" + - name: loadgen + image: quay.io/kruizehub/tfb_hyperfoil_load:0.25.2 + imagePullPolicy: IfNotPresent + command: ["/bin/sh","-c"] + args: + - | + echo "Waiting for TFB to be ready..." + for i in $(seq 1 120); do + if wget -qO- http://localhost:8080/plaintext > /dev/null; then + echo "TFB is ready" + break + fi + sleep 1 + done + + if ! wget -qO- http://localhost:8080/plaintext > /dev/null; then + echo "TFB did not become ready" + exit 1 + fi + + echo "Starting hyperfoil load (same as docker run)..." + /opt/run_hyperfoil_load.sh \ + localhost:8080 \ + queries?queries=20 \ + 1200 \ + 1024 \ + 8096 + echo "wrk finished" + +--- +apiVersion: v1 +kind: Service +metadata: + name: tfb-qrh-service + annotations: + prometheus.io/scrape: 'true' + prometheus.io/path: '/q/metrics' + labels: + app: tfb-qrh-app +spec: + type: NodePort + ports: + - port: 8080 + targetPort: 8080 + name: tfb-qrh-port + selector: + name: tfb-qrh-deployment diff --git a/techempower/manifests/kruize-runtimes/service-monitor.yaml b/techempower/manifests/kruize-runtimes/service-monitor.yaml new file mode 100644 index 00000000..62898b69 --- /dev/null +++ b/techempower/manifests/kruize-runtimes/service-monitor.yaml @@ -0,0 +1,13 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: tfb-qrh + labels: + team: tfb-qrh-frontend +spec: + selector: + matchLabels: + app: tfb-qrh-app + endpoints: + - port: tfb-qrh-port + path: '/q/metrics' From 483803a5cf0b309bca9c36eab8df4436fe23ce86 Mon Sep 17 00:00:00 2001 From: kusuma chalasani Date: Mon, 2 Mar 2026 16:53:40 +0530 Subject: [PATCH 2/4] Include manifests specific to kruize-demos Signed-off-by: kusuma chalasani --- .../manifests/kruize-demos/petclinic.yaml | 93 +++++++++++++ .../kruize-demos/service-monitor.yaml | 14 ++ .../postgres.yaml | 4 +- .../quarkus-resteasy-hibernate.yaml | 123 ++++++++++++++++++ .../service-monitor.yaml | 0 .../quarkus-resteasy-hibernate.yaml | 89 ------------- 6 files changed, 232 insertions(+), 91 deletions(-) create mode 100644 spring-petclinic/manifests/kruize-demos/petclinic.yaml create mode 100644 spring-petclinic/manifests/kruize-demos/service-monitor.yaml rename techempower/manifests/{kruize-runtimes => kruize-demos}/postgres.yaml (96%) create mode 100644 techempower/manifests/kruize-demos/quarkus-resteasy-hibernate.yaml rename techempower/manifests/{kruize-runtimes => kruize-demos}/service-monitor.yaml (100%) delete mode 100644 techempower/manifests/kruize-runtimes/quarkus-resteasy-hibernate.yaml diff --git a/spring-petclinic/manifests/kruize-demos/petclinic.yaml b/spring-petclinic/manifests/kruize-demos/petclinic.yaml new file mode 100644 index 00000000..d320645b --- /dev/null +++ b/spring-petclinic/manifests/kruize-demos/petclinic.yaml @@ -0,0 +1,93 @@ +# 1. PetClinic Service: Fixed port 8081 and matching selectors +apiVersion: v1 +kind: Service +metadata: + name: petclinic-service + annotations: + prometheus.io/scrape: 'true' + prometheus.io/path: '/manage/prometheus' +spec: + type: NodePort + ports: + - port: 8081 + targetPort: 8081 + nodePort: 32334 + name: petclinic-port + selector: + app: petclinic-deployment +--- +# 2. PetClinic Deployment: Updated with your specific image and labels +apiVersion: apps/v1 +kind: Deployment +metadata: + name: petclinic-sample +spec: + replicas: 1 + selector: + matchLabels: + app: petclinic-deployment + template: + metadata: + labels: + app: petclinic-deployment + app.kubernetes.io/name: "petclinic-deployment" + version: v1 + spec: + containers: + - name: petclinic-tomcat + image: quay.io/kruizehub/spring_petclinic:2.2.0-jdk-11.0.8-openj9-0.21.0 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8081 + volumeMounts: + - name: "test-volume" + mountPath: "/opt/jLogs" + # Readiness probe ensures the Load Job waits for the actual JVM to start + readinessProbe: + httpGet: + path: / + port: 8081 + initialDelaySeconds: 20 + periodSeconds: 10 + volumes: + - name: test-volume + emptyDir: {} +--- +# 3. JMeter Load Job: Coordinated to start only when Service is ready +apiVersion: batch/v1 +kind: Job +metadata: + name: petclinic-load-generator +spec: + template: + spec: + # Wait logic ensures JMeter doesn't fire into a void while Tomcat is booting + initContainers: + - name: wait-for-petclinic + image: busybox:1.28 + command: ['sh', '-c', "until nc -z petclinic-service 8081; do echo 'Waiting for PetClinic...'; sleep 2; done;"] + containers: + - name: petclinic-load + image: quay.io/kruizehub/spring_petclinic_load:jmeter_3.3 + command: ["/bin/sh", "-c"] + args: + - | + cd /jmeter/apache-jmeter-${JMETER_VERSION} + + # STAGE 1: Low Load (50 Users) + echo "Starting Stage 1: 50 Users..." + ./bin/jmeter -n -t petclinic.jmx -Jduration=900 -Jusers=50 \ + -JPETCLINIC_HOST=petclinic-service -JPETCLINIC_PORT=8081 + + # STAGE 2: Medium Load (100 Users) + echo "Starting Stage 2: 100 Users..." + ./bin/jmeter -n -t petclinic.jmx -Jduration=600 -Jusers=100 \ + -JPETCLINIC_HOST=petclinic-service -JPETCLINIC_PORT=8081 + + # STAGE 3: Peak Load (150 Users) + echo "Starting Stage 3: 150 Users..." + ./bin/jmeter -n -t petclinic.jmx -Jduration=300 -Jusers=150 \ + -JPETCLINIC_HOST=petclinic-service -JPETCLINIC_PORT=8081 + restartPolicy: Never + backoffLimit: 2 + diff --git a/spring-petclinic/manifests/kruize-demos/service-monitor.yaml b/spring-petclinic/manifests/kruize-demos/service-monitor.yaml new file mode 100644 index 00000000..396e00da --- /dev/null +++ b/spring-petclinic/manifests/kruize-demos/service-monitor.yaml @@ -0,0 +1,14 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: petclinic + labels: + team: petclinic-frontend +spec: + selector: + matchLabels: + app: petclinic-app + endpoints: + - port: petclinic-port + path: '/manage/prometheus' + diff --git a/techempower/manifests/kruize-runtimes/postgres.yaml b/techempower/manifests/kruize-demos/postgres.yaml similarity index 96% rename from techempower/manifests/kruize-runtimes/postgres.yaml rename to techempower/manifests/kruize-demos/postgres.yaml index 4e8a48fd..1ee0e63b 100644 --- a/techempower/manifests/kruize-runtimes/postgres.yaml +++ b/techempower/manifests/kruize-demos/postgres.yaml @@ -37,8 +37,8 @@ spec: - containerPort: 5432 resources: requests: - cpu: 2 - memory: "1024Mi" + cpu: 0.5 + memory: "512Mi" limits: cpu: 2 memory: "1024Mi" diff --git a/techempower/manifests/kruize-demos/quarkus-resteasy-hibernate.yaml b/techempower/manifests/kruize-demos/quarkus-resteasy-hibernate.yaml new file mode 100644 index 00000000..2aac36f9 --- /dev/null +++ b/techempower/manifests/kruize-demos/quarkus-resteasy-hibernate.yaml @@ -0,0 +1,123 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: tfb-qrh-sample + labels: + app: tfb-qrh-app +spec: + replicas: 1 + selector: + matchLabels: + app: tfb-qrh-deployment + template: + metadata: + labels: + name: tfb-qrh-deployment + app: tfb-qrh-deployment + # Add label to the application which is used by kruize/autotune to monitor it + app.kubernetes.io/name: "tfb-qrh-deployment" + app.kubernetes.io/layer: "quarkus" + version: v1 + spec: + volumes: + - name: test-volume + containers: + - name: tfb-server + image: quay.io/kruizehub/tfb-qrh:1.13.2.F_et17 + imagePullPolicy: IfNotPresent + env: + - name: "JAVA_OPTIONS" + value: "-server" + ports: + - containerPort: 8080 + resources: + requests: + cpu: 1.5 + memory: "512Mi" + limits: + cpu: 3.5 + memory: "2048Mi" + volumeMounts: + - name: "test-volume" + mountPath: "/opt/jLogs" +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: tfb-qrh-load-generator +spec: + template: + spec: + terminationGracePeriodSeconds: 0 + # Wait for Quarkus to be ready before starting the load + initContainers: + - name: wait-for-tfb + image: busybox:1.28 + command: ['sh', '-c'] + args: + - | + echo "Waiting for TFB (/plaintext) to be ready..." + for i in $(seq 1 120); do + if wget -qO- http://tfb-qrh-service:8080/plaintext > /dev/null; then + echo "TFB is ready!" + exit 0 + fi + echo "Waiting for app... ($i/120)" + sleep 1 + done + echo "ERROR: TFB did not respond in 2 minutes." + exit 1 + containers: + - name: tfb-qrh-load + image: quay.io/kruizehub/tfb_hyperfoil_load:0.25.2 + env: + - name: TARGET + value: "tfb-qrh-service:8080" + command: ["/bin/sh", "-c"] + args: + - | + echo "Starting 30-minute Multi-Endpoint Benchmark..." + + # --- PHASE 1: Combined Ramp-up (5 mins) --- + for conn in 50 150 300; do + echo "Ramping up: ${conn} connections..." + /opt/run_hyperfoil_load.sh $TARGET "plaintext" 30 12 $conn + /opt/run_hyperfoil_load.sh $TARGET "db" 30 12 $conn + /opt/run_hyperfoil_load.sh $TARGET "queries?queries=20" 40 12 $conn + done + + # --- PHASE 2: Plaintext (CPU focus - 8 mins) --- + echo "Phase 2: High Throughput (Plaintext)..." + /opt/run_hyperfoil_load.sh $TARGET "plaintext" 480 12 400 + + # --- PHASE 3: DB Query (Pool focus - 8 mins) --- + echo "Phase 3: DB Driver & Connection Pool..." + /opt/run_hyperfoil_load.sh $TARGET "db" 480 12 400 + + # --- PHASE 4: Hibernate (Memory focus - 9 mins) --- + echo "Phase 4: Complex ORM & Memory Allocation..." + /opt/run_hyperfoil_load.sh $TARGET "queries?queries=20" 540 12 500 + + echo "Full benchmark complete. Entering 2-minute cooldown..." + sleep 120 + restartPolicy: Never + backoffLimit: 1 + +--- +apiVersion: v1 +kind: Service +metadata: + name: tfb-qrh-service + annotations: + prometheus.io/scrape: 'true' + prometheus.io/path: '/q/metrics' + labels: + app: tfb-qrh-app +spec: + type: NodePort + ports: + - port: 8080 + targetPort: 8080 + name: tfb-qrh-port + selector: + name: tfb-qrh-deployment diff --git a/techempower/manifests/kruize-runtimes/service-monitor.yaml b/techempower/manifests/kruize-demos/service-monitor.yaml similarity index 100% rename from techempower/manifests/kruize-runtimes/service-monitor.yaml rename to techempower/manifests/kruize-demos/service-monitor.yaml diff --git a/techempower/manifests/kruize-runtimes/quarkus-resteasy-hibernate.yaml b/techempower/manifests/kruize-runtimes/quarkus-resteasy-hibernate.yaml deleted file mode 100644 index f2889fdd..00000000 --- a/techempower/manifests/kruize-runtimes/quarkus-resteasy-hibernate.yaml +++ /dev/null @@ -1,89 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: tfb-qrh-sample - labels: - app: tfb-qrh-app -spec: - replicas: 1 - selector: - matchLabels: - app: tfb-qrh-deployment - template: - metadata: - labels: - name: tfb-qrh-deployment - app: tfb-qrh-deployment - # Add label to the application which is used by kruize/autotune to monitor it - app.kubernetes.io/name: "tfb-qrh-deployment" - app.kubernetes.io/layer: "quarkus" - version: v1 - spec: - volumes: - - name: test-volume - containers: - - name: tfb-server - image: quay.io/kruizehub/tfb-qrh:1.13.2.F_et17 - imagePullPolicy: IfNotPresent - env: - - name: "JAVA_OPTIONS" - value: "-server" - ports: - - containerPort: 8080 - resources: - requests: - cpu: 0.5 - memory: "512Mi" - limits: - cpu: 3.5 - memory: "2048Mi" - volumeMounts: - - name: "test-volume" - mountPath: "/opt/jLogs" - - name: loadgen - image: quay.io/kruizehub/tfb_hyperfoil_load:0.25.2 - imagePullPolicy: IfNotPresent - command: ["/bin/sh","-c"] - args: - - | - echo "Waiting for TFB to be ready..." - for i in $(seq 1 120); do - if wget -qO- http://localhost:8080/plaintext > /dev/null; then - echo "TFB is ready" - break - fi - sleep 1 - done - - if ! wget -qO- http://localhost:8080/plaintext > /dev/null; then - echo "TFB did not become ready" - exit 1 - fi - - echo "Starting hyperfoil load (same as docker run)..." - /opt/run_hyperfoil_load.sh \ - localhost:8080 \ - queries?queries=20 \ - 1200 \ - 1024 \ - 8096 - echo "wrk finished" - ---- -apiVersion: v1 -kind: Service -metadata: - name: tfb-qrh-service - annotations: - prometheus.io/scrape: 'true' - prometheus.io/path: '/q/metrics' - labels: - app: tfb-qrh-app -spec: - type: NodePort - ports: - - port: 8080 - targetPort: 8080 - name: tfb-qrh-port - selector: - name: tfb-qrh-deployment From c1fd5d05064aff4d9b95efbdd8e43fe16328b0c8 Mon Sep 17 00:00:00 2001 From: kusumachalasani Date: Thu, 12 Mar 2026 17:29:55 +0530 Subject: [PATCH 3/4] Include labels to scrape the data to prometheus --- spring-petclinic/manifests/kruize-demos/petclinic.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spring-petclinic/manifests/kruize-demos/petclinic.yaml b/spring-petclinic/manifests/kruize-demos/petclinic.yaml index d320645b..cdfd2d7e 100644 --- a/spring-petclinic/manifests/kruize-demos/petclinic.yaml +++ b/spring-petclinic/manifests/kruize-demos/petclinic.yaml @@ -6,6 +6,8 @@ metadata: annotations: prometheus.io/scrape: 'true' prometheus.io/path: '/manage/prometheus' + labels: + app: petclinic-app spec: type: NodePort ports: @@ -21,6 +23,8 @@ apiVersion: apps/v1 kind: Deployment metadata: name: petclinic-sample + labels: + app: petclinic-app spec: replicas: 1 selector: @@ -29,6 +33,7 @@ spec: template: metadata: labels: + name: petclinic-deployment app: petclinic-deployment app.kubernetes.io/name: "petclinic-deployment" version: v1 From c5bb3b2fb6a456d511d514f950ffe58960eedcff Mon Sep 17 00:00:00 2001 From: kusumachalasani Date: Fri, 13 Mar 2026 19:40:38 +0530 Subject: [PATCH 4/4] specifying the volume --- .../manifests/kruize-demos/quarkus-resteasy-hibernate.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/techempower/manifests/kruize-demos/quarkus-resteasy-hibernate.yaml b/techempower/manifests/kruize-demos/quarkus-resteasy-hibernate.yaml index 2aac36f9..555522ca 100644 --- a/techempower/manifests/kruize-demos/quarkus-resteasy-hibernate.yaml +++ b/techempower/manifests/kruize-demos/quarkus-resteasy-hibernate.yaml @@ -21,6 +21,7 @@ spec: spec: volumes: - name: test-volume + emptyDir: {} containers: - name: tfb-server image: quay.io/kruizehub/tfb-qrh:1.13.2.F_et17