Skip to content

Commit 09464de

Browse files
Address Helm review feedback
1 parent 4663963 commit 09464de

5 files changed

Lines changed: 24 additions & 10 deletions

File tree

‎Dockerfile‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ WORKDIR /app
1414
# HOST=0.0.0.0 so Kubernetes Service/probe traffic reaches the process.
1515
ENV NODE_ENV=production \
1616
STANDALONE=false \
17-
HOST=0.0.0.0 \
18-
HOME=/tmp
17+
HOST=0.0.0.0
1918

2019
ARG APP_VERSION
2120
RUN test -n "$APP_VERSION" || (echo "APP_VERSION build-arg is required" >&2 && exit 1)
@@ -25,7 +24,7 @@ RUN npm install --omit=dev "@truefoundry/trueforge@${APP_VERSION}" \
2524
&& npm cache clean --force
2625

2726
RUN groupadd --gid 10001 trueforge \
28-
&& useradd --uid 10001 --gid trueforge --home-dir /tmp --no-create-home --shell /usr/sbin/nologin trueforge
27+
&& useradd --uid 10001 --gid trueforge --shell /usr/sbin/nologin trueforge
2928

3029
EXPOSE 8790
3130

‎Dockerfile.dev‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
7171
# runner: minimal image with prod node_modules + built artifacts.
7272
# ---------------------------------------------------------------------------
7373
FROM base AS runner
74-
ENV NODE_ENV=production \
75-
HOME=/tmp
74+
ENV NODE_ENV=production
7675

7776
# Production dependency tree (pnpm workspace symlinks preserved).
7877
COPY --from=prod-deps /app/node_modules ./node_modules
@@ -93,7 +92,7 @@ COPY --from=frontend-builder /app/packages/frontend/dist ./packages/trueforge/di
9392
WORKDIR /app/packages/trueforge
9493

9594
RUN groupadd --gid 10001 trueforge \
96-
&& useradd --uid 10001 --gid trueforge --home-dir /tmp --no-create-home --shell /usr/sbin/nologin trueforge
95+
&& useradd --uid 10001 --gid trueforge trueforge
9796

9897
EXPOSE 8790
9998

‎charts/trueforge/README.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,16 @@ extraObjects:
207207
| `podDisruptionBudget.enabled` | `false` | Enable a PodDisruptionBudget (`minAvailable` defaults to `1`). |
208208
| `podSecurityContext` | non-root UID/GID `10001` | Pod-level restricted security defaults. |
209209
| `securityContext` | read-only root FS + drop all capabilities | Container-level restricted security defaults. |
210-
| `resources` | `{}` | Container resource requests/limits. |
210+
| `resources` | 100m/256Mi requests, 200m/512Mi limits | Container CPU, memory, and ephemeral-storage requests/limits. |
211211

212212
Also available (defaults inert): `strategy`, `priorityClassName`,
213213
`topologySpreadConstraints`, `initContainers`, `extraContainers`,
214214
`extraVolumes`, `extraVolumeMounts`, `service.annotations`, `service.labels`,
215215
`startupProbe`.
216216

217217
The server container mounts an `emptyDir` at `/tmp` by default so the image can
218-
run with `readOnlyRootFilesystem: true`.
218+
run with `readOnlyRootFilesystem: true`. When set, `resources.limits.ephemeral-storage`
219+
also sets the `/tmp` `emptyDir.sizeLimit`.
219220

220221
## Production checklist
221222

@@ -225,6 +226,6 @@ run with `readOnlyRootFilesystem: true`.
225226
- Set `server.publicBaseUrl` to the real public origin before using MCP OAuth or OIDC.
226227
- Prefer `valueFrom.secretKeyRef` for Postgres password, Redis URL, and OIDC client secret; do not commit secrets in values files.
227228
- Prefer external managed Postgres/Redis over the bundled subcharts for production HA.
228-
- Set container `resources` (especially CPU requests) before enabling HPA.
229+
- Tune container `resources` (especially CPU requests) before enabling HPA.
229230
- Default `tfy.jfrog.io` images and the Helm chart are anonymously pullable — set `imagePullSecrets` only if you override to a private registry.
230231
- Enable `podDisruptionBudget` when running multiple replicas (defaults to `minAvailable: 1`; set exactly one of `minAvailable` or `maxUnavailable`).

‎charts/trueforge/templates/deployment.yaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,16 @@ spec:
8484
{{- with .Values.extraContainers }}
8585
{{- toYaml . | nindent 8 }}
8686
{{- end }}
87+
{{- $resources := default dict .Values.resources }}
88+
{{- $limits := default dict (index $resources "limits") }}
8789
volumes:
8890
- name: tmp
91+
{{- with index $limits "ephemeral-storage" }}
92+
emptyDir:
93+
sizeLimit: {{ . | quote }}
94+
{{- else }}
8995
emptyDir: {}
96+
{{- end }}
9097
{{- with .Values.extraVolumes }}
9198
{{- toYaml . | nindent 8 }}
9299
{{- end }}

‎charts/trueforge/values.yaml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,15 @@ extraContainers: []
185185
# Extra volumes / mounts on the server container (e.g. CA bundles, projected tokens).
186186
extraVolumes: []
187187
extraVolumeMounts: []
188-
resources: {}
188+
resources:
189+
requests:
190+
cpu: 100m
191+
memory: 256Mi
192+
ephemeral-storage: 256Mi
193+
limits:
194+
cpu: 200m
195+
memory: 512Mi
196+
ephemeral-storage: 512Mi
189197
# startupProbe runs until success before liveness/readiness; sized for migrate + Redis connect.
190198
startupProbe:
191199
httpGet:

0 commit comments

Comments
 (0)