Skip to content

Commit b300c22

Browse files
committed
feat(server): add gateway capacity metrics and optional HPA
Expose per-replica supervisor sessions, pending relay capacity, relay rejections and claim latency, and outbound peer request outcomes and latency. Use bounded labels and Prometheus histograms for the new latency metrics while preserving existing summary metrics. Add an optional Helm HPA with external-database and resource validation, conservative scale-down defaults, and support for custom metrics. Keep certificate hook pods outside gateway workload selectors. Document per-pod scraping, scaling limits and upgrade behavior, and add a task for PostgreSQL-backed server tests. Ensure legacy test configuration always uses the selected disposable database, with a regression check in the standard test suite. Part of #3528 Signed-off-by: Emilien Macchi <emacchi@redhat.com>
1 parent fde79f1 commit b300c22

25 files changed

Lines changed: 2630 additions & 68 deletions

‎.agents/skills/helm-dev-environment/SKILL.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ for dependencies still declared in `Chart.yaml`.
449449
| `deploy/helm/openshell/ci/values-cert-manager.yaml` | cert-manager PKI overlay (opt-in; disables pkiInitJob) |
450450
| `deploy/helm/openshell/ci/values-gateway.yaml` | Envoy Gateway GRPCRoute + Gateway overlay |
451451
| `deploy/helm/openshell/ci/values-high-availability.yaml` | HA test overlay (`replicaCount: 2` with external PostgreSQL Secret) |
452+
| `deploy/helm/openshell/ci/values-autoscaling.yaml` | Render-only overlay for the optional gateway HorizontalPodAutoscaler (helm lint and helm-unittest) |
452453
| `deploy/helm/openshell/ci/values-keycloak.yaml` | Keycloak OIDC overlay |
453454
| `deploy/helm/openshell/ci/values-spire.yaml` | SPIFFE/SPIRE provider token grant overlay |
454455
| `deploy/helm/openshell/ci/values-spire-stack.yaml` | SPIRE hardened chart values for local dev |

‎TESTING.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,25 @@ mise run test:rust # cargo test --workspace
4848

4949
Rust validation checks tracked Cargo lockfiles; run `mise run rust:lockfiles:check` to check them directly. If one is stale, refresh it with Cargo using its adjacent manifest, review the diff, and commit the update.
5050

51+
### PostgreSQL-backed tests
52+
53+
Tests that need a real PostgreSQL server are `#[ignore]`d and named
54+
`postgres_*`. Run them with:
55+
56+
```shell
57+
mise run test:rust:postgres
58+
```
59+
60+
The task starts a disposable PostgreSQL container with Docker or Podman
61+
(set `CONTAINER_ENGINE` to choose), runs the tests one at a time, and removes
62+
the container. Each test works in its own temporary schema. To use your own
63+
disposable database, set `OPENSHELL_TEST_POSTGRES_URL`. The task overrides
64+
`OPENSHELL_REPLAY_TEST_DATABASE_URL` so legacy tests use that same database.
65+
Never point it at a database that a running gateway uses: the tests take
66+
fleet-wide advisory locks.
67+
CI does not run these tests; the Kubernetes HA e2e suite covers PostgreSQL end
68+
to end.
69+
5170
### Native Windows validation
5271

5372
Use `mise run --skip-tools pre-commit` with the existing Rust/MSVC toolchain.

0 commit comments

Comments
 (0)