# qorgh529/test-orca architecture

> Architecture diagram of the GitHub repository qorgh529/test-orca, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/qorgh529/test-orca
- Repository: https://github.com/qorgh529/test-orca

## Overview

This repository combines the Spring PetClinic application with its AWS EKS runtime architecture. The main user path is internet traffic through the protected AWS edge and Gateway API routing, then the NGINX web tier and Tomcat-hosted application, which accesses MySQL on RDS. Separate operational branches cover canary traffic control, scaling, secrets, backups, and observability. The README documents these relationships; source excerpts were unavailable, so application-internal calls are not inferred.

Main entry points: [`k8s/was`](https://github.com/qorgh529/test-orca/tree/master/k8s/was) (Tomcat PetClinic), [`docker/web/nginx.conf`](https://github.com/qorgh529/test-orca/blob/master/docker/web/nginx.conf) (Nginx web tier), [`k8s/gateway/httproute-canary.yaml`](https://github.com/qorgh529/test-orca/blob/master/k8s/gateway/httproute-canary.yaml) (Canary HTTPRoute), [`k8s/tracing/otel-collector-values.yaml`](https://github.com/qorgh529/test-orca/blob/master/k8s/tracing/otel-collector-values.yaml) (OTel Collector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_edge["Traffic Entry"]
  node_edge_security{{"DNS, TLS, WAF"}}
  node_alb{{"AWS ALB"}}
  node_gateway["NGINX Gateway"]
  node_route["Canary HTTPRoute"]
end

subgraph group_app["PetClinic Runtime"]
  node_web["Nginx web tier<br/>[nginx.conf]"]
  node_static["Static assets"]
  node_was["Tomcat PetClinic"]
  node_application["PetClinic application"]
end

subgraph group_ops["Deployment and Scaling"]
  node_canary_control["Canary rollout control"]
  node_autoscaling["WAS autoscaling"]
  node_web_scaling["Web autoscaling<br/>[hpa.yaml]"]
end

subgraph group_data["Data and Secrets"]
  node_rds[("RDS MySQL")]
  node_db_init["DB initialization<br/>[job-db-init.yaml]"]
  node_backup["DB backup job"]
  node_backup_store[("S3 backup storage")]
  node_secrets[("Secrets Manager")]
  node_eso["External Secrets"]
end

subgraph group_observe["Observability"]
  node_prometheus["Prometheus"]
  node_collector["OTel Collector"]
  node_tempo[("Tempo traces<br/>[tempo-values.yaml]")]
  node_grafana["Grafana"]
  node_trace_store[("Tempo S3 storage")]
end

node_visitor(("Web user"))

node_visitor -->|"requests site"| node_edge_security
node_edge_security -->|"protects and routes"| node_alb
node_alb -->|"forwards traffic"| node_gateway
node_gateway -->|"applies routes"| node_route
node_route -->|"routes by weight"| node_web
node_web -->|"serves assets"| node_static
node_web -->|"proxies requests"| node_was
node_was -->|"hosts application"| node_application
node_application -->|"reads and writes"| node_rds
node_canary_control -->|"sets traffic weight"| node_route
node_db_init -->|"initializes schema"| node_rds
node_backup -->|"reads backup data"| node_rds
node_backup -->|"stores daily backup"| node_backup_store
node_secrets -->|"provides credentials"| node_eso
node_eso -->|"syncs app secret"| node_was
node_web_scaling -->|"scales replicas"| node_web
node_autoscaling -->|"scales replicas"| node_was
node_was -->|"exports OTLP"| node_collector
node_was -->|"exposes metrics"| node_prometheus
node_prometheus -->|"scrapes metrics"| node_collector
node_collector -->|"exports traces"| node_tempo
node_grafana -->|"queries traces"| node_tempo
node_tempo -->|"stores traces"| node_trace_store

click node_gateway "https://github.com/qorgh529/test-orca/tree/master/k8s/gateway"
click node_route "https://github.com/qorgh529/test-orca/blob/master/k8s/gateway/httproute-canary.yaml"
click node_web "https://github.com/qorgh529/test-orca/blob/master/docker/web/nginx.conf"
click node_static "https://github.com/qorgh529/test-orca/tree/master/app/src/main/webapp/resources"
click node_was "https://github.com/qorgh529/test-orca/tree/master/k8s/was"
click node_application "https://github.com/qorgh529/test-orca/tree/master/app/src/main/java/org/springframework/samples/petclinic"
click node_db_init "https://github.com/qorgh529/test-orca/blob/master/k8s/jobs/job-db-init.yaml"
click node_backup "https://github.com/qorgh529/test-orca/blob/master/k8s/jobs/cronjob-db-backup.yaml"
click node_eso "https://github.com/qorgh529/test-orca/tree/master/k8s/secrets"
click node_canary_control "https://github.com/qorgh529/test-orca/blob/master/scripts/set-canary-weight.sh"
click node_autoscaling "https://github.com/qorgh529/test-orca/blob/master/k8s/was/keda-scaledobject.yaml"
click node_web_scaling "https://github.com/qorgh529/test-orca/blob/master/k8s/web/hpa.yaml"
click node_prometheus "https://github.com/qorgh529/test-orca/blob/master/k8s/monitoring/kube-prometheus-values.yaml"
click node_collector "https://github.com/qorgh529/test-orca/blob/master/k8s/tracing/otel-collector-values.yaml"
click node_tempo "https://github.com/qorgh529/test-orca/blob/master/k8s/tracing/tempo-values.yaml"
click node_grafana "https://github.com/qorgh529/test-orca/blob/master/k8s/monitoring/kube-prometheus-values.yaml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_edge_security,node_alb,node_gateway,node_route,node_visitor toneBlue
class node_web,node_static,node_was,node_application toneAmber
class node_canary_control,node_autoscaling,node_web_scaling toneMint
class node_rds,node_db_init,node_backup,node_backup_store,node_secrets,node_eso toneRose
class node_prometheus,node_collector,node_tempo,node_grafana,node_trace_store toneIndigo
```

## Components

### Traffic Entry

- **DNS, TLS, WAF**
- **AWS ALB**
- [NGINX Gateway](https://github.com/qorgh529/test-orca/tree/master/k8s/gateway): `k8s/gateway`
- [Canary HTTPRoute](https://github.com/qorgh529/test-orca/blob/master/k8s/gateway/httproute-canary.yaml): `k8s/gateway/httproute-canary.yaml`

### PetClinic Runtime

- [Nginx web tier](https://github.com/qorgh529/test-orca/blob/master/docker/web/nginx.conf): `docker/web/nginx.conf`
- [Static assets](https://github.com/qorgh529/test-orca/tree/master/app/src/main/webapp/resources): `app/src/main/webapp/resources`
- [Tomcat PetClinic](https://github.com/qorgh529/test-orca/tree/master/k8s/was): `k8s/was`
- [PetClinic application](https://github.com/qorgh529/test-orca/tree/master/app/src/main/java/org/springframework/samples/petclinic): `app/src/main/java/org/springframework/samples/petclinic`

### Deployment and Scaling

- [Canary rollout control](https://github.com/qorgh529/test-orca/blob/master/scripts/set-canary-weight.sh): `scripts/set-canary-weight.sh`
- [WAS autoscaling](https://github.com/qorgh529/test-orca/blob/master/k8s/was/keda-scaledobject.yaml): `k8s/was/keda-scaledobject.yaml`
- [Web autoscaling](https://github.com/qorgh529/test-orca/blob/master/k8s/web/hpa.yaml): `k8s/web/hpa.yaml`

### Data and Secrets

- **RDS MySQL**
- [DB initialization](https://github.com/qorgh529/test-orca/blob/master/k8s/jobs/job-db-init.yaml): `k8s/jobs/job-db-init.yaml`
- [DB backup job](https://github.com/qorgh529/test-orca/blob/master/k8s/jobs/cronjob-db-backup.yaml): `k8s/jobs/cronjob-db-backup.yaml`
- **S3 backup storage**
- **Secrets Manager**
- [External Secrets](https://github.com/qorgh529/test-orca/tree/master/k8s/secrets): `k8s/secrets`

### Observability

- [Prometheus](https://github.com/qorgh529/test-orca/blob/master/k8s/monitoring/kube-prometheus-values.yaml): `k8s/monitoring/kube-prometheus-values.yaml`
- [OTel Collector](https://github.com/qorgh529/test-orca/blob/master/k8s/tracing/otel-collector-values.yaml): `k8s/tracing/otel-collector-values.yaml`
- [Tempo traces](https://github.com/qorgh529/test-orca/blob/master/k8s/tracing/tempo-values.yaml): `k8s/tracing/tempo-values.yaml`
- [Grafana](https://github.com/qorgh529/test-orca/blob/master/k8s/monitoring/kube-prometheus-values.yaml): `k8s/monitoring/kube-prometheus-values.yaml`
- **Tempo S3 storage**

### Other components

- **Web user**

## Connections

- Web user → DNS, TLS, WAF: requests site (evidence: `README.md`)
- DNS, TLS, WAF → AWS ALB: protects and routes (evidence: `README.md`)
- AWS ALB → NGINX Gateway: forwards traffic (evidence: `README.md`)
- NGINX Gateway → Canary HTTPRoute: applies routes (evidence: `README.md`)
- Canary HTTPRoute → Nginx web tier: routes by weight (evidence: `README.md`)
- Nginx web tier → Static assets: serves assets (evidence: `README.md`)
- Nginx web tier → Tomcat PetClinic: proxies requests (evidence: `README.md`)
- Tomcat PetClinic → PetClinic application: hosts application (evidence: `README.md`)
- PetClinic application → RDS MySQL: reads and writes (evidence: `README.md`)
- Canary rollout control → Canary HTTPRoute: sets traffic weight (evidence: `README.md`)
- DB initialization → RDS MySQL: initializes schema (evidence: `README.md`)
- DB backup job → RDS MySQL: reads backup data (evidence: `README.md`)
- DB backup job → S3 backup storage: stores daily backup (evidence: `README.md`)
- Secrets Manager → External Secrets: provides credentials (evidence: `README.md`)
- External Secrets → Tomcat PetClinic: syncs app secret (evidence: `README.md`)
- Web autoscaling → Nginx web tier: scales replicas (evidence: `README.md`)
- WAS autoscaling → Tomcat PetClinic: scales replicas (evidence: `README.md`)
- Tomcat PetClinic → OTel Collector: exports OTLP (evidence: `README.md`)
- Tomcat PetClinic → Prometheus: exposes metrics (evidence: `README.md`)
- Prometheus → OTel Collector: scrapes metrics (evidence: `README.md`)
- OTel Collector → Tempo traces: exports traces (evidence: `README.md`)
- Grafana → Tempo traces: queries traces (evidence: `README.md`)
- Tempo traces → Tempo S3 storage: stores traces (evidence: `README.md`)
