Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
25a16b9
feat: migrate manifests from Ingress to Gateway API (HTTPRoute)
TineoC Mar 21, 2026
1ea8894
feat: configure HTTPRoute for sandbox.balancerproject.org
TineoC Mar 21, 2026
1484428
feat: add sandbox and production overlays for HTTPRoute
TineoC Mar 21, 2026
6f50887
cleanup: remove unused dev overlay
TineoC Mar 21, 2026
4cbb380
feat(gateway): implement self-service TLS via ListenerSet
TineoC Apr 18, 2026
cc3fbe9
fix(gateway): update overlays to patch ListenerSet hostnames
TineoC Apr 18, 2026
b9c9591
feat(gateway): implement HTTP to HTTPS redirect via ListenerSet
TineoC Apr 18, 2026
fb7b270
fix(gateway): patch hostname for redirect HTTPRoute in overlays
TineoC Apr 18, 2026
b1e4918
Configure CORS Allowed Origins via ConfigMaps
TineoC Apr 18, 2026
00250ef
Update sandbox domain for CORS
TineoC Apr 18, 2026
8262de5
Refine ConfigMap overlays using env files and correct sandbox domain
TineoC Apr 18, 2026
d97f0c9
feat: add balancer database cluster manifest
TineoC Apr 18, 2026
92fd46d
remove redundant cluster manifest (moved to infra repo)
TineoC Apr 18, 2026
cf324fb
remove db.yaml from kustomization resources
TineoC Apr 18, 2026
c6f001d
feat: add sandbox overlay with shared db connection details
TineoC Apr 18, 2026
76af69f
feat: update sandbox overlay to use shared db password from secret
TineoC Apr 18, 2026
e48e52d
feat: add configmap for database settings in sandbox overlay
TineoC Apr 18, 2026
d725fe0
feat: update kustomization to use configmap and secret for db settings
TineoC Apr 18, 2026
99523c9
feat: move database manifest to base and update SQL_HOST for shared-c…
TineoC May 1, 2026
98ec6b4
Merge branch 'pr-482' into integrate-all-migration
TineoC May 7, 2026
7ab8480
Merge branch 'pr-500' into integrate-all-migration
TineoC May 7, 2026
920e0cd
Merge branch 'pr-501' into integrate-all-migration
TineoC May 7, 2026
06359c5
fix: remove redundant namespace patch on database.yaml
TineoC May 7, 2026
1af2d30
fix: move Database CRD to cfp-sandbox-cluster infra
TineoC May 7, 2026
e8bfa66
fix: move Database CRD to sandbox-only CNPG kustomization
TineoC May 7, 2026
7a0b6ad
fix: remove redundant balancer-redirect HTTPRoute (covered by global …
TineoC May 18, 2026
96c9612
fix: simplify balancer kustomize overlays and add common labels
TineoC May 18, 2026
f71f943
fix: update production to v1.1.5
TineoC May 18, 2026
e0ca2df
fix: use image tags without v prefix (1.1.5)
TineoC May 18, 2026
1072a98
fix: align version label with image tag format (1.1.5)
TineoC May 18, 2026
524d022
fix: remove version label, use image tag as source of truth
TineoC May 18, 2026
a033298
feat(sandbox): add balancer-db-credentials SealedSecret for CNPG
May 18, 2026
6249ed3
chore(sandbox): remove cnpg overlay — CNPG resources belong in cfp-sa…
May 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
2 changes: 2 additions & 0 deletions deploy/manifests/balancer/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ spec:
envFrom:
- secretRef:
name: balancer-config
- configMapRef:
name: balancer-config
ports:
- containerPort: 8000
readinessProbe:
Expand Down
27 changes: 27 additions & 0 deletions deploy/manifests/balancer/base/gateway-listeners.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: gateway.networking.k8s.io/v1
kind: ListenerSet
metadata:
name: balancer-listeners
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
hostname: HOSTNAME_PLACEHOLDER
spec:
parentRef:
name: main-gateway
namespace: envoy-gateway-system
group: gateway.networking.k8s.io
kind: Gateway
listeners:
- name: http
protocol: HTTP
port: 80
hostname: HOSTNAME_PLACEHOLDER
- name: https
protocol: HTTPS
port: 443
hostname: HOSTNAME_PLACEHOLDER
tls:
mode: Terminate
certificateRefs:
- name: balancer-tls
kind: Secret
23 changes: 23 additions & 0 deletions deploy/manifests/balancer/base/httproute.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: balancer
annotations:
hostname: HOSTNAME_PLACEHOLDER
spec:
parentRefs:
- name: balancer-listeners
kind: ListenerSet
group: gateway.networking.k8s.io
sectionName: https
hostnames:
- HOSTNAME_PLACEHOLDER
rules:
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: balancer
port: 80
23 changes: 0 additions & 23 deletions deploy/manifests/balancer/base/ingress.yaml

This file was deleted.

18 changes: 17 additions & 1 deletion deploy/manifests/balancer/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,20 @@ resources:
- namespace.yaml
- deployment.yaml
- service.yaml
- ingress.yaml
- gateway-listeners.yaml
- httproute.yaml

labels:
- pairs:
app.kubernetes.io/name: balancer
app.kubernetes.io/part-of: balancer
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/component: web

images:
- name: ghcr.io/codeforphilly/balancer-main/app

configMapGenerator:
- name: balancer-config
envs:
- balancer.env
2 changes: 1 addition & 1 deletion deploy/manifests/balancer/base/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
spec:
ports:
- name: http
port: 8000
port: 80
targetPort: 8000
selector:
app: balancer
26 changes: 0 additions & 26 deletions deploy/manifests/balancer/overlays/dev/kustomization.yaml

This file was deleted.

1 change: 1 addition & 0 deletions deploy/manifests/balancer/overlays/production/balancer.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CORS_ALLOWED_ORIGINS=https://balancerproject.org
44 changes: 44 additions & 0 deletions deploy/manifests/balancer/overlays/production/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: balancer

resources:
- ../../base

images:
- name: ghcr.io/codeforphilly/balancer-main/app
newTag: 1.1.5

configMapGenerator:
- name: balancer-config
behavior: merge
literals:
- HOSTNAME=balancerproject.org
envs:
- balancer.env

labels:
- includeSelectors: true
pairs:
environment: production
app.kubernetes.io/instance: balancer-production

patches:
- target:
kind: ListenerSet
name: balancer-listeners
patch: |
- op: replace
path: /spec/listeners/0/hostname
value: balancerproject.org
- op: replace
path: /spec/listeners/1/hostname
value: balancerproject.org
- target:
kind: HTTPRoute
name: balancer
patch: |
- op: replace
path: /spec/hostnames/0
value: balancerproject.org
1 change: 1 addition & 0 deletions deploy/manifests/balancer/overlays/sandbox/balancer.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CORS_ALLOWED_ORIGINS=https://sandbox.balancerproject.org
10 changes: 10 additions & 0 deletions deploy/manifests/balancer/overlays/sandbox/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: balancer-db-config
data:
SQL_HOST: shared-cluster-rw.cloudnative-pg.svc.cluster.local
SQL_PORT: "5432"
SQL_DATABASE: balancer
SQL_USER: balancer
SQL_ENGINE: django.db.backends.postgresql
62 changes: 62 additions & 0 deletions deploy/manifests/balancer/overlays/sandbox/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: balancer

resources:
- ../../base
- configmap.yaml

images:
- name: ghcr.io/codeforphilly/balancer-main/app
newTag: 1.1.5

configMapGenerator:
- name: balancer-config
behavior: merge
literals:
- HOSTNAME=sandbox.balancerproject.org
envs:
- balancer.env

labels:
- includeSelectors: true
pairs:
environment: sandbox
app.kubernetes.io/instance: balancer-sandbox

patches:
- target:
kind: ListenerSet
name: balancer-listeners
patch: |
- op: replace
path: /spec/listeners/0/hostname
value: sandbox.balancerproject.org
- op: replace
path: /spec/listeners/1/hostname
value: sandbox.balancerproject.org
- target:
kind: HTTPRoute
name: balancer
patch: |
- op: replace
path: /spec/hostnames/0
value: sandbox.balancerproject.org
- target:
kind: Deployment
name: balancer
patch: |
- op: add
path: /spec/template/spec/containers/0/envFrom/-
value:
configMapRef:
name: balancer-db-config
- op: add
path: /spec/template/spec/containers/0/env
value:
- name: SQL_PASSWORD
valueFrom:
secretKeyRef:
name: balancer-db-credentials
key: password
5 changes: 4 additions & 1 deletion server/balancer_backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@

ROOT_URLCONF = "balancer_backend.urls"

CORS_ALLOW_ALL_ORIGINS = True
# CORS configuration
CORS_ALLOWED_ORIGINS = os.environ.get("CORS_ALLOWED_ORIGINS", "http://localhost:3000").split(",")
# Ensure no empty strings if input was empty or trailing comma
CORS_ALLOWED_ORIGINS = [origin.strip() for origin in CORS_ALLOWED_ORIGINS if origin.strip()]

TEMPLATES = [
{
Expand Down
Loading