Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion helm/smooai-next/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ type: application
# (SMOODEV-1790 — dogfooding the chart for smooai apps/web).
# 0.2.1: PDB sets unhealthyPodEvictionPolicy (default AlwaysAllow) — kube-linter
# flags its absence; matches the prior hand-rolled PDB.
version: 0.2.1
# 0.2.2: expose hpa.memoryTarget — optional second HPA Resource metric (memory
# averageUtilization) so memory-pressured Next.js pods scale out instead
# of riding into a V8 heap-limit OOM (SMOODEV-1965). Default 0 = CPU-only,
# backward-compatible.
version: 0.2.2
# Tracks the consuming app image version (override via image.tag).
appVersion: "0.1.0"
home: https://github.com/SmooAI/deploy
Expand Down
2 changes: 1 addition & 1 deletion helm/smooai-next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ helm/smooai-next/
│ ├── _helpers.tpl
│ ├── deployment.yaml # node server.js; graceful shutdown; /api/health probes; S3 cache env
│ ├── service.yaml # ClusterIP, port → http (3000)
│ ├── hpa.yaml # HPA (min/max/cpuTarget)
│ ├── hpa.yaml # HPA (min/max/cpuTarget; optional memoryTarget)
│ ├── pdb.yaml # PodDisruptionBudget (minAvailable)
│ ├── serviceaccount.yaml # IRSA-annotated ServiceAccount
│ ├── ingress.yaml # dedicated internet-facing ALB = the CloudFront origin
Expand Down
13 changes: 13 additions & 0 deletions helm/smooai-next/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ spec:
target:
type: Utilization
averageUtilization: {{ .Values.hpa.cpuTarget }}
{{- with .Values.hpa.memoryTarget }}
# Optional memory-based scale-out (averageUtilization is % of the memory
# REQUEST). The HPA scales UP when EITHER metric is hot and DOWN only when
# BOTH are cool — so memory-pressured Next.js pods add replicas instead of
# riding individual pods into a V8 heap-limit OOM. `with` skips this when
# memoryTarget is unset/0, keeping the default CPU-only behavior unchanged.
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ . }}
{{- end }}
{{- with .Values.hpa.behavior }}
# Optional v2 scaling behavior (scaleUp/scaleDown stabilization + policies).
behavior:
Expand Down
8 changes: 8 additions & 0 deletions helm/smooai-next/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ hpa:
min: 2
max: 10
cpuTarget: 70
# Optional memory-based scale-out target — averageUtilization as a % of the
# memory REQUEST (resources.requests.memory below). Unset/0 = CPU-only (the
# default; backward-compatible). Set e.g. 80 to add a second HPA metric so a
# memory-pressured Next.js workload scales out instead of riding each pod into
# a V8 heap-limit OOM. The HPA scales UP when EITHER cpu or memory is hot and
# DOWN only when BOTH are cool, so set this comfortably ABOVE steady-state
# (memory-used ÷ memory-request) or it will pin the deployment at max.
memoryTarget: 0
# Optional autoscaling/v2 scaling behavior (scaleUp/scaleDown stabilization
# windows + policies). Empty = the autoscaler's built-in defaults. Example:
# behavior:
Expand Down
Loading