Skip to content

feat: integrate Gateway API, CORS config, and CNPG database for sandbox#507

Open
TineoC wants to merge 25 commits intoCodeForPhilly:developfrom
TineoC:integrate-all-migration
Open

feat: integrate Gateway API, CORS config, and CNPG database for sandbox#507
TineoC wants to merge 25 commits intoCodeForPhilly:developfrom
TineoC:integrate-all-migration

Conversation

@TineoC
Copy link
Copy Markdown
Collaborator

@TineoC TineoC commented May 7, 2026

Summary

Integrates three migration changes into a single branch for sandbox deployment:

  1. Gateway API migration (from feat: migrate manifests from Ingress to Gateway API (HTTPRoute) #482): Replaces Ingress with HTTPRoute + ListenerSet for Envoy Gateway support
  2. CORS configuration (from Configure CORS Allowed Origins via ConfigMaps #500): Makes CORS allowed origins configurable via ConfigMap and environment variables
  3. CNPG database (from feat: add balancer database cluster manifest #501): Adds Database CRD resource and sandbox overlay with shared PostgreSQL cluster connection

Changes:

  • Base manifests: IngressHTTPRoute + ListenerSet, added database.yaml and configMapGenerator
  • Sandbox overlay: Gateway hostname patches, CORS ConfigMap merge, CNPG balancer-db-config ConfigMap + deployment patches
  • Production overlay: Gateway hostname patches, CORS ConfigMap merge
  • Deployment: envFrom now includes both balancer-config (secret + CORS configmap) and balancer-db-config (DB connection)

Depends on:

Closes:

Test plan:

  • Verify kustomize build deploy/manifests/balancer/overlays/sandbox renders correctly
  • Deploy to sandbox and confirm balancer starts with CNPG connection
  • Verify CORS headers are correctly set for sandbox.balancerproject.org

TineoC added 22 commits March 21, 2026 11:07
This change migrates the Gateway API configuration to use ListenerSets instead of 
attaching HTTPRoutes directly to the Gateway. This enables the self-service TLS 
model where the application manages its own listeners and certificates.
This updates the sandbox and production overlays to correctly patch the hostnames 
on both the ListenerSet and the HTTPRoute.
This adds a redirect HTTPRoute targeting the port 80 listener of the 
ListenerSet, ensuring all HTTP traffic is upgraded to HTTPS. The main 
HTTPRoute is now pinned to the port 443 listener.
Updates the sandbox and production overlays to ensure the hostname is also 
patched on the new balancer-redirect HTTPRoute.
# Conflicts:
#	deploy/manifests/balancer/base/kustomization.yaml
#	deploy/manifests/balancer/overlays/production/kustomization.yaml
#	deploy/manifests/balancer/overlays/sandbox/kustomization.yaml
# Conflicts:
#	deploy/manifests/balancer/base/kustomization.yaml
#	deploy/manifests/balancer/overlays/sandbox/kustomization.yaml
database.yaml already has namespace: cloudnative-pg hardcoded.
The kustomize patch was a no-op replacing the same value.
TineoC added 2 commits May 7, 2026 17:51
The Database resource must live in the cloudnative-pg namespace alongside
the Cluster CRD. Kustomize's namespace field overrides all resources,
making it impossible to keep a cross-namespace resource in the app overlay.
Moved to infra/cloudnative-pg/balancer-database.yaml in cfp-sandbox-cluster.
Kustomize's namespace field overrides ALL resources, making it impossible
to keep the Database in cloudnative-pg namespace within the main overlay.
Created a separate kustomization at overlays/sandbox/cnpg/ without the
namespace field, so the Database stays in cloudnative-pg namespace.

This keeps sandbox and production databases separate - production overlay
has no CNPG resources.
TineoC added a commit to TineoC/cfp-sandbox-cluster that referenced this pull request May 7, 2026
- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant