Skip to content

Commit 80e2fb4

Browse files
committed
fix(helm): review round — whitelabeled realtime HPA opt-out, external-db isolation on with required CIDR in install flow
- values-whitelabeled now actually sets autoscaling.realtime.enabled: false (the earlier batch aborted before reaching this file — Cursor caught it) - external-db keeps networkPolicy enabled (no isolation regression); the DB egress CIDR is marked REQUIRED and wired into both documented install commands via --set, so the copy-paste flow sets the real subnet in the same breath as the DB host
1 parent 47cff49 commit 80e2fb4

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

helm/sim/examples/values-external-db.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# --set externalDatabase.username=simstudio_user \
2020
# --set externalDatabase.password="$DB_PASSWORD" \
2121
# --set externalDatabase.database=simstudio_prod \
22+
# --set "networkPolicy.egress[0].to[0].ipBlock.cidr=<YOUR_DB_CIDR>" \
2223
# --set app.env.BETTER_AUTH_SECRET="$BETTER_AUTH_SECRET" \
2324
# --set app.env.ENCRYPTION_KEY="$ENCRYPTION_KEY" \
2425
# --set app.env.INTERNAL_API_SECRET="$INTERNAL_API_SECRET"
@@ -170,20 +171,18 @@ monitoring:
170171
interval: 15s
171172

172173
networkPolicy:
173-
# Disabled by default so a verbatim install can always reach your database.
174-
# To opt into network isolation: replace the placeholder CIDR below with your
175-
# database's subnet (or /32 host) FIRST, then set enabled: true — with the
176-
# policy on, the chart's egress allowlist only covers the in-cluster Postgres,
177-
# so an external DB on 5432 is unreachable without this rule, and a wrong
178-
# CIDR blocks migrations and all database connections.
179-
enabled: false
180-
# `networkPolicy.egress` is a LIST of NetworkPolicy egress rules. Scope `to`
181-
# to your database — an empty `to:` would allow the pods to reach ANY host
182-
# on 5432, defeating the isolation this teaches.
174+
enabled: true
175+
# `networkPolicy.egress` is a LIST of NetworkPolicy egress rules. With the
176+
# policy on, the chart's egress allowlist only covers the in-cluster
177+
# Postgres, so this rule is what lets the pods reach your external database.
178+
# The CIDR is a placeholder: REQUIRED — set your database's subnet (or /32
179+
# host) via the --set line in the install commands below (or edit it here).
180+
# A wrong CIDR blocks migrations and every database connection; an empty
181+
# `to:` would allow ANY host on 5432 and defeat the isolation.
183182
egress:
184183
- to:
185184
- ipBlock:
186-
cidr: 10.0.0.0/16 # REPLACE with your database subnet or /32 host CIDR
185+
cidr: 10.0.0.0/16 # REQUIRED - your database subnet or /32 host CIDR
187186
ports:
188187
- protocol: TCP
189188
port: 5432
@@ -195,6 +194,7 @@ networkPolicy:
195194
# --set externalDatabase.username="your-db-user" \
196195
# --set externalDatabase.password="your-db-password" \
197196
# --set externalDatabase.database="your-db-name" \
197+
# --set "networkPolicy.egress[0].to[0].ipBlock.cidr=<YOUR_DB_CIDR>" \
198198
# --set app.env.BETTER_AUTH_SECRET="$(openssl rand -hex 32)" \
199199
# --set app.env.ENCRYPTION_KEY="$(openssl rand -hex 32)" \
200200
# --set app.env.INTERNAL_API_SECRET="$(openssl rand -hex 32)" \

helm/sim/examples/values-whitelabeled.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,13 @@ ingress:
9898
secretName: "sim-acme-tls"
9999

100100
# Auto-scaling
101-
# NOTE: autoscaling also renders an HPA for realtime with the same minReplicas,
102-
# overriding realtime.replicaCount. Multi-replica realtime REQUIRES REDIS_URL in
103-
# app.env (Socket.IO Redis adapter) or cross-pod collaboration events are lost.
104101
autoscaling:
105102
enabled: true
103+
# Keep realtime out of the HPA until REDIS_URL is set (Socket.IO Redis
104+
# adapter) — multi-replica realtime without Redis silently drops cross-pod
105+
# collaboration events.
106+
realtime:
107+
enabled: false
106108
minReplicas: 2
107109
maxReplicas: 10
108110
targetCPUUtilizationPercentage: 70

0 commit comments

Comments
 (0)