feat(balancer): clean design with shared-cluster cnpg + Envoy Gateway#160
Merged
Conversation
Restructures balancer to the design we settled on before the
Envoy/Gateway migration:
balancer/
kustomization.yaml — wrapper, resources: [app, cnpg]
app/
kustomization.yaml — namespace: balancer, references mapped base
manifests/ — mapped from balancer-main base via hologit
cnpg/
kustomization.yaml — no namespace
database.yaml — Database CR in cloudnative-pg namespace
Why this layout:
- Single hololens (no `balancer-cnpg.toml`)
- `Database` CR lives next to the balancer config in this repo but
cnpg requires it to live in the cluster's namespace (cloudnative-pg).
The cnpg sub-kustomization sets no namespace; database.yaml carries
its own; k8s-normalize routes by resource at deploy time.
- Replaces and supersedes PR #143 (TineoC's two-lens approach with the
sort-order hack and mutable `develop` source ref).
Holosource bumped v1.1.3 → v1.1.5 (latest balancer-main release).
Holomapping filters out `ingress.yaml` (replaced by `_gateways/balancer.yaml`)
and the upstream `kustomization.yaml` (we compose our own).
Also adds `_gateways/balancer.yaml`: per-app Gateway + HTTPRoute on
`balancer.sandbox.k8s.phl.io`. Hostname matches what `secret.template.yaml`
documents and aligns with the per-app pattern used by the other sandbox
apps post-PR-#152.
Database resource will be applied but only fully usable after the
`balancer-db-credentials` SealedSecret is created in the cloudnative-pg
namespace and the balancer app's `balancer-config` is updated to point
SQL_HOST at `shared-cluster-rw.cloudnative-pg.svc.cluster.local` with
the new credentials. That cutover (data migration from the current RDS
host) is a separate follow-up.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restructures balancer to the clean design we settled on before going down the Envoy/Gateway rabbit hole. Now that all prereqs are in place (Gateway API CRDs, cert-manager 1.20 with gatewayHTTPRoute solver, hairpin-proxy gone), we can land it.
Supersedes PR #143 (two-lens approach, ASCII sort-order hack, mutable
developsource ref).What changes
Workspace restructure
Why this layout
balancer-cnpg.toml, no sort-order tricksmetadata.namespace: cloudnative-pgcarries through. The cnpg sub-kustomization sets no namespace; k8s-normalize routes by resource at deploy time.Hologit
v1.1.3 → v1.1.5(latest balancer-main release).holo/branches/k8s-manifests/balancer/app/manifests.toml(was.../balancer/manifests.toml)filesfilter explicitly enumeratesnamespace.yaml,deployment.yaml,service.yaml— drops the upstreamingress.yaml(replaced by_gateways/balancer.yaml) and the upstreamkustomization.yaml(we compose our own)Gateway + HTTPRoute
Adds
_gateways/balancer.yamlmatching the per-app pattern from PR #152:Gateway/balancerwith HTTPS listener onbalancer.sandbox.k8s.phl.ioHTTPRoute/balancerwith parentRef only to the per-app Gateway (HTTP redirects globally via_infra/envoy-gateway/http-redirect.yamlfrom PR feat(gateway-tls): force HTTP→HTTPS via global redirect HTTPRoute #154)cert-manager.io/cluster-issuer: letsencrypt-prodannotation → auto-issuesbalancer-gw-tlsHostname matches what
balancer-main/deploy/manifests/balancer/base/secret.template.yamldocuments (REACT_APP_API_BASE_URL: https://balancer.sandbox.k8s.phl.io/) and aligns with the other sandbox apps.Diff vs deployed
Existing balancer Deployment, Service, Namespace, SealedSecret stay identical (same upstream content). No drift.
Not in this PR (follow-ups)
balancer-db-credentialsSealedSecret — theshared-clusteralready has amanaged.roles[balancer]entry pointing at this Secret name incloudnative-pgnamespace, but the Secret doesn't exist yet. cnpg has reconciled the role with an empty password. Needs a SealedSecret with a generated password.balancer-configSealedSecret currently pointsSQL_HOSTat an external RDS instance (balancer-jj.cab6cwkqwif9.us-east-1.rds.amazonaws.com). Migration toshared-cluster-rw.cloudnative-pg.svc.cluster.localrequires data migration + coordinated SealedSecret update. This PR adds the empty target database; the cutover happens later.balancer-db-configConfigMap and CORS env vars. Deferred to a follow-up after the DB cutover when the actual settings firm up.🤖 Generated with Claude Code