6bf8bebf51
CI / Test and Build (push) Failing after 1s
CI / Migrate Dev DB (push) Has been skipped
CI / Migrate DB (push) Has been skipped
CodeQL / Analyze actions (push) Has been cancelled
CodeQL / Analyze javascript-typescript (push) Has been cancelled
CI / Detect Version (push) Has been cancelled
CI / Detect Desktop Changes (push) Has been cancelled
CI / Build AMD64 (blacksmith-2vcpu-ubuntu-2404, ./docker/cron.Dockerfile, ubuntu-latest, ghcr.io/simstudioai/cron) (push) Has been cancelled
CI / Build AMD64 (blacksmith-2vcpu-ubuntu-2404, ./docker/db.Dockerfile, ECR_MIGRATIONS, ubuntu-latest, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (blacksmith-4vcpu-ubuntu-2404, ./docker/pii.Dockerfile, ECR_PII, ubuntu-latest, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (blacksmith-4vcpu-ubuntu-2404, ./docker/realtime.Dockerfile, ECR_REALTIME, ubuntu-latest, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build AMD64 (blacksmith-8vcpu-ubuntu-2404, ./docker/app.Dockerfile, ECR_APP, linux-x64-8-core, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/cron.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/cron) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/db.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/pii.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/realtime.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-8vcpu-ubuntu-2404-arm, ./docker/app.Dockerfile, linux-arm64-8-core, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
Helm Chart / Lint, test, and validate chart (push) Has been cancelled
Helm Chart / Chart version bumped (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
CI / Build Dev ECR (blacksmith-8vcpu-ubuntu-2404, ./docker/app.Dockerfile, ECR_APP, linux-x64-8-core) (push) Has been cancelled
CI / Promote Images (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/cron) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build Dev ECR (blacksmith-2vcpu-ubuntu-2404, ./docker/db.Dockerfile, ECR_MIGRATIONS, ubuntu-latest) (push) Has been cancelled
CI / Build Dev ECR (blacksmith-4vcpu-ubuntu-2404, ./docker/pii.Dockerfile, ECR_PII, ubuntu-latest) (push) Has been cancelled
CI / Build Dev ECR (blacksmith-4vcpu-ubuntu-2404, ./docker/realtime.Dockerfile, ECR_REALTIME, ubuntu-latest) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Check Desktop Signing Secrets (push) Has been cancelled
CI / Desktop Release (push) Has been cancelled
CI / Create Desktop Prerelease (push) Has been cancelled
CI / Desktop Prerelease Build (push) Has been cancelled
CI / Publish Desktop Prerelease (push) Has been cancelled
CI / Prune Desktop Prereleases (push) Has been cancelled
Helm Chart / Install on kind and run helm test (push) Has been cancelled
207 lines
9.8 KiB
YAML
207 lines
9.8 KiB
YAML
{{- if .Values.app.enabled }}
|
|
{{- include "sim.validateSecrets" . }}
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "sim.fullname" . }}-app
|
|
namespace: {{ .Release.Namespace }}
|
|
labels:
|
|
{{- include "sim.app.labels" . | nindent 4 }}
|
|
spec:
|
|
{{- if not .Values.autoscaling.enabled }}
|
|
replicas: {{ .Values.app.replicaCount }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "sim.app.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
{{- /* Hash the inline Secret AND the ExternalSecret manifest so spec
|
|
changes under externalSecrets.remoteRefs.app roll the pods (with ESO
|
|
enabled the inline Secret renders empty and would hash to a constant).
|
|
Rotated values inside the external store still can't be detected at
|
|
render time — ESO's own reconciliation handles those. */}}
|
|
checksum/secret: {{ printf "%s%s" (include (print $.Template.BasePath "/secrets-app.yaml") .) (include (print $.Template.BasePath "/external-secret-app.yaml") .) | sha256sum }}
|
|
{{- if .Values.branding.enabled }}
|
|
checksum/config: {{ include (print $.Template.BasePath "/configmap-branding.yaml") . | sha256sum }}
|
|
{{- end }}
|
|
{{- with .Values.podAnnotations }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "sim.app.selectorLabels" . | nindent 8 }}
|
|
{{- with .Values.podLabels }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- with .Values.global.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "sim.serviceAccountName" . }}
|
|
automountServiceAccountToken: false
|
|
{{- include "sim.podSecurityContext" .Values.app | nindent 6 }}
|
|
{{- include "sim.nodeSelector" .Values.app | nindent 6 }}
|
|
{{- include "sim.tolerations" .Values | nindent 6 }}
|
|
{{- include "sim.affinity" .Values | nindent 6 }}
|
|
{{- include "sim.topologySpreadConstraints" .Values.app | nindent 6 }}
|
|
{{- if .Values.migrations.enabled }}
|
|
initContainers:
|
|
- name: migrations
|
|
image: {{ include "sim.image" (dict "imageRoot" .Values.migrations.image "global" .Values.global "chartAppVersion" .Chart.AppVersion) }}
|
|
imagePullPolicy: {{ .Values.migrations.image.pullPolicy }}
|
|
command: ["/bin/sh", "-c"]
|
|
args:
|
|
- |
|
|
cd /app/packages/db
|
|
export DATABASE_URL="{{ include "sim.databaseUrl" . }}"
|
|
bun run db:migrate
|
|
envFrom:
|
|
{{- if .Values.postgresql.enabled }}
|
|
- secretRef:
|
|
name: {{ include "sim.postgresqlSecretName" . }}
|
|
{{- else if .Values.externalDatabase.enabled }}
|
|
- secretRef:
|
|
name: {{ include "sim.externalDbSecretName" . }}
|
|
{{- end }}
|
|
{{- include "sim.resources" .Values.migrations | nindent 10 }}
|
|
{{- include "sim.containerSecurityContext" .Values.migrations | nindent 10 }}
|
|
{{- end }}
|
|
containers:
|
|
- name: app
|
|
image: {{ include "sim.image" (dict "imageRoot" .Values.app.image "global" .Values.global "chartAppVersion" .Chart.AppVersion) }}
|
|
imagePullPolicy: {{ .Values.app.image.pullPolicy }}
|
|
ports:
|
|
- name: http
|
|
containerPort: {{ .Values.app.service.targetPort }}
|
|
protocol: TCP
|
|
{{- /*
|
|
All keys from .Values.app.env are mounted via envFrom (see below).
|
|
Chart-computed values and operational tunables (.Values.app.envDefaults)
|
|
are inlined here so they don't leak into the chart-managed Secret and
|
|
don't need to be mapped when externalSecrets.enabled=true.
|
|
*/}}
|
|
env:
|
|
- name: DATABASE_URL
|
|
value: {{ include "sim.databaseUrl" . | quote }}
|
|
- name: SOCKET_SERVER_URL
|
|
value: {{ include "sim.socketServerUrl" . | quote }}
|
|
- name: OLLAMA_URL
|
|
value: {{ include "sim.ollamaUrl" . | quote }}
|
|
- name: PII_URL
|
|
value: {{ include "sim.piiUrl" . | quote }}
|
|
{{- /*
|
|
Skip envDefaults keys that the user has explicitly overridden in app.env
|
|
with a non-empty value. K8s `env` takes precedence over `envFrom`, so an
|
|
inline default would otherwise mask the user's Secret-bound value.
|
|
Also skip envDefaults entirely in existingSecret mode: the pre-existing
|
|
Secret is the source of truth, and inlining localhost URL defaults would
|
|
silently shadow keys (NEXT_PUBLIC_APP_URL, BETTER_AUTH_URL, etc.) the
|
|
user stored in their Secret but left empty in app.env.
|
|
*/}}
|
|
{{- $appEnv := .Values.app.env | default dict }}
|
|
{{- $useExistingSecret := and .Values.app.secrets.existingSecret.enabled (not .Values.externalSecrets.enabled) }}
|
|
{{- if not $useExistingSecret }}
|
|
{{- range $key, $value := .Values.app.envDefaults | default dict }}
|
|
{{- $override := index $appEnv $key }}
|
|
{{- if and (ne (toString $value) "") (ne (toString $value) "<nil>") (or (not $override) (eq (toString $override) "") (eq (toString $override) "<nil>")) }}
|
|
- name: {{ $key }}
|
|
value: {{ $value | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- /*
|
|
In existingSecret mode the chart-managed Secret is not rendered, so
|
|
non-empty values in app.env would otherwise go nowhere — inline them
|
|
here so the user's overrides actually reach the pod. Skipped in ESO
|
|
mode (ESO is the source of truth; inlining would mask the synced value)
|
|
and in inline mode (values flow through the chart-managed Secret).
|
|
*/}}
|
|
{{- if and .Values.app.secrets.existingSecret.enabled (not .Values.externalSecrets.enabled) }}
|
|
{{- $chartComputed := list "DATABASE_URL" "SOCKET_SERVER_URL" "OLLAMA_URL" "PII_URL" }}
|
|
{{- range $key, $value := $appEnv }}
|
|
{{- if and (ne (toString $value) "") (ne (toString $value) "<nil>") (not (has $key $chartComputed)) }}
|
|
- name: {{ $key }}
|
|
value: {{ $value | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.telemetry.enabled }}
|
|
{{- $nodeEnv := default (default "production" (index (.Values.app.envDefaults | default dict) "NODE_ENV")) (index (.Values.app.env | default dict) "NODE_ENV") }}
|
|
# OpenTelemetry configuration
|
|
- name: OTEL_EXPORTER_OTLP_ENDPOINT
|
|
value: "http://{{ include "sim.fullname" . }}-otel-collector:4318"
|
|
- name: OTEL_SERVICE_NAME
|
|
value: sim-app
|
|
- name: OTEL_SERVICE_VERSION
|
|
value: {{ .Chart.AppVersion | quote }}
|
|
- name: OTEL_RESOURCE_ATTRIBUTES
|
|
value: "service.name=sim-app,service.version={{ .Chart.AppVersion }},deployment.environment={{ $nodeEnv }}"
|
|
{{- end }}
|
|
{{- with .Values.extraEnvVars }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
envFrom:
|
|
# Bundled Redis URL. Listed FIRST so any operator-supplied REDIS_URL
|
|
# in a later source overrides it — see templates/configmap-redis.yaml.
|
|
{{- if include "sim.chartManagesRedis" . }}
|
|
- configMapRef:
|
|
name: {{ include "sim.fullname" . }}-redis
|
|
{{- end }}
|
|
# App secrets (authentication, encryption keys)
|
|
- secretRef:
|
|
name: {{ include "sim.appSecretName" . }}
|
|
# Database secrets
|
|
{{- if .Values.postgresql.enabled }}
|
|
- secretRef:
|
|
name: {{ include "sim.postgresqlSecretName" . }}
|
|
{{- else if .Values.externalDatabase.enabled }}
|
|
- secretRef:
|
|
name: {{ include "sim.externalDbSecretName" . }}
|
|
{{- end }}
|
|
{{- if .Values.app.startupProbe }}
|
|
startupProbe:
|
|
{{- toYaml .Values.app.startupProbe | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.app.livenessProbe }}
|
|
livenessProbe:
|
|
{{- toYaml .Values.app.livenessProbe | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.app.readinessProbe }}
|
|
readinessProbe:
|
|
{{- toYaml .Values.app.readinessProbe | nindent 12 }}
|
|
{{- end }}
|
|
{{- include "sim.resources" .Values.app | nindent 10 }}
|
|
{{- include "sim.containerSecurityContext" .Values.app | nindent 10 }}
|
|
{{- $hasBranding := and .Values.branding.enabled (or .Values.branding.files .Values.branding.binaryFiles) }}
|
|
{{- if or $hasBranding .Values.extraVolumeMounts .Values.app.extraVolumeMounts }}
|
|
volumeMounts:
|
|
{{- if $hasBranding }}
|
|
- name: branding
|
|
mountPath: {{ .Values.branding.mountPath | default "/app/public/branding" }}
|
|
readOnly: true
|
|
{{- end }}
|
|
{{- with .Values.extraVolumeMounts }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.app.extraVolumeMounts }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- $hasBranding := and .Values.branding.enabled (or .Values.branding.files .Values.branding.binaryFiles) }}
|
|
{{- if or $hasBranding .Values.extraVolumes .Values.app.extraVolumes }}
|
|
volumes:
|
|
{{- if $hasBranding }}
|
|
- name: branding
|
|
configMap:
|
|
name: {{ include "sim.fullname" . }}-branding
|
|
{{- end }}
|
|
{{- with .Values.extraVolumes }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.app.extraVolumes }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }} |