Skip to content

feat(balancer): integrate sandbox overlay with CNPG + Gateway API + CORS#143

Closed
TineoC wants to merge 4 commits into
CodeForPhilly:mainfrom
TineoC:feat/balancer-cnpg-integration
Closed

feat(balancer): integrate sandbox overlay with CNPG + Gateway API + CORS#143
TineoC wants to merge 4 commits into
CodeForPhilly:mainfrom
TineoC:feat/balancer-cnpg-integration

Conversation

@TineoC
Copy link
Copy Markdown
Contributor

@TineoC TineoC commented May 7, 2026

Summary

Updates the balancer hologit projection to use the integrated sandbox overlay from balancer-main, which includes:

  1. Gateway API migrationIngressHTTPRoute + ListenerSet for Envoy Gateway
  2. CORS configuration — Configurable allowed origins via ConfigMap
  3. CNPG databaseDatabase CRD for shared PostgreSQL cluster + balancer-db-config ConfigMap

Changes:

  • .holo/sources/balancer.toml: Points to integration branch (TineoC/balancer-main#integrate-all-migration)
  • .holo/branches/k8s-manifests/balancer/manifests.toml: Root changed from baseoverlays/sandbox

Depends on:

Post-merge:

  • After #507 merges, update balancer.toml source to point to the main repo tag instead of the fork
  • Run git holo project k8s-manifests-github to verify projection
  • Verify balancer-db-credentials SealedSecret exists in cloudnative-pg namespace

Related:

- Update balancer source to use integration branch (TineoC/balancer-main#integrate-all-migration)
- Change holomapping root from base to overlays/sandbox for CNPG + Gateway API + CORS changes
- Depends on CodeForPhilly/balancer-main#507
@TineoC TineoC requested a review from a team as a code owner May 7, 2026 21:25
@TineoC TineoC requested review from themightychris and removed request for a team May 7, 2026 21:25
TineoC added 3 commits May 7, 2026 17:51
Moved from balancer-main base manifests. The Database CRD must be in the
same namespace as the Cluster (cloudnative-pg). Kustomize's namespace
override in the app overlay was incorrectly placing it in the balancer namespace.
- Remove balancer-database.yaml from infra (now in balancer-main sandbox overlay)
- Update lens root from 'balancer' to 'balancer/manifests/overlays/sandbox'
  so kustomize build finds the correct kustomization.yaml
- Update balancer source to track CodeForPhilly/balancer-main develop branch
- Add balancer-cnpg.toml lens for the CNPG Database kustomization
  (separate lens needed because kustomize namespace override prevents
  including it as a resource in the main overlay)

Depends on CodeForPhilly/balancer-main#507 merging into develop.
[holomapping]
holosource = "balancer"
root = "deploy/manifests/balancer/base"
root = "deploy/manifests/balancer/overlays/sandbox"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TineoC this path doesn't exist on the develop branch in the balancer repo: https://github.com/CodeForPhilly/balancer-main/tree/develop/deploy/manifests/balancer/overlays

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NVM just saw #507 over in the balancer repo

@themightychris
Copy link
Copy Markdown
Member

Superseded by PR #160 (`feat(balancer): clean design with shared-cluster cnpg + Envoy Gateway`). Closing.

The clean design we landed solves all three concerns in this PR without requiring balancer-main#507 upstream, and without the two-lens / sort-order workarounds:

Concern from this PR How PR #160 addresses it
Gateway API migration (IngressHTTPRoute) _gateways/balancer.yaml with per-app Gateway + HTTPRoute on balancer.sandbox.k8s.phl.io. Cert auto-issued. HTTP→HTTPS handled globally.
CNPG database (Database CR + role) balancer/cnpg/database.yaml in cloudnative-pg namespace; targets shared-cluster; owner: balancer (the role already exists on the cluster). Database is applied and ready, empty, waiting for the data migration.
CORS configuration via ConfigMap Deferred — the original ConfigMap shape was coupled to upstream #507's overlay layout. Easier to add cleanly once the DB cutover happens and the actual values firm up.

Layout in this repo now:

balancer/
├── kustomization.yaml          # wrapper, resources: [app, cnpg], no namespace
├── app/
│   ├── kustomization.yaml      # namespace: balancer
│   └── manifests/              # mapped from balancer-main v1.1.5 base via hologit
└── cnpg/
    ├── kustomization.yaml      # no namespace
    └── database.yaml           # Database CR with metadata.namespace: cloudnative-pg

Single hololens, single source pinned to a real tag (no mutable develop), no dependency on balancer-main#507. The Database CR + balancer role co-locate in cloudnative-pg per cnpg's same-namespace requirement; k8s-normalize routes the workspace-side resources to the right places at deploy time.

What's left to actually run balancer on the new database is tracked in a separate follow-up issue (linked once I file it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Architecture] Migrate ingress-nginx to supported alternative (EOL March 2026)

2 participants