Files
multica/deploy/helm/multica/templates/configmap.yaml
feifeigood 30e1e546cf MUL-3355: feat(helm): support external PostgreSQL via postgres.external.enabled
Closes #4237

Add a `postgres.external.enabled` toggle (default: false) so operators
can skip the built-in Deployment/PVC/Service and point Multica at any
externally managed PostgreSQL (CNPG, RDS, Cloud SQL, Neon, etc.).

When enabled:
- postgres Deployment, PVC, and ClusterIP Service are not rendered
- The hard-coded DATABASE_URL env var is omitted from the backend pod;
  DATABASE_URL must be supplied in existingSecret and reaches the
  container through the existing envFrom.secretRef mechanism
- POSTGRES_DB / POSTGRES_USER are omitted from the ConfigMap (unused
  when DATABASE_URL is provided directly)

Also update the existingSecret creation example in values.yaml to show
both the built-in and external-postgres variants so users know to add
DATABASE_URL instead of POSTGRES_PASSWORD when switching modes.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-03 13:56:10 +08:00

33 lines
1.6 KiB
YAML

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-config
labels:
{{- include "multica.labels" . | nindent 4 }}
data:
# --- Backend ---
PORT: "8080"
APP_ENV: {{ .Values.backend.config.appEnv | quote }}
MULTICA_APP_URL: {{ .Values.backend.config.appUrl | quote }}
FRONTEND_ORIGIN: {{ .Values.backend.config.frontendOrigin | quote }}
CORS_ALLOWED_ORIGINS: {{ .Values.backend.config.corsAllowedOrigins | quote }}
COOKIE_DOMAIN: {{ .Values.backend.config.cookieDomain | quote }}
RESEND_FROM_EMAIL: {{ .Values.backend.config.resendFromEmail | quote }}
ALLOW_SIGNUP: {{ .Values.backend.config.allowSignup | quote }}
ALLOWED_EMAILS: {{ .Values.backend.config.allowedEmails | quote }}
ALLOWED_EMAIL_DOMAINS: {{ .Values.backend.config.allowedEmailDomains | quote }}
DISABLE_WORKSPACE_CREATION: {{ .Values.backend.config.disableWorkspaceCreation | quote }}
GOOGLE_CLIENT_ID: {{ .Values.backend.config.googleClientId | quote }}
GOOGLE_REDIRECT_URI: {{ .Values.backend.config.googleRedirectUri | quote }}
S3_BUCKET: {{ .Values.backend.config.s3Bucket | quote }}
S3_REGION: {{ .Values.backend.config.s3Region | quote }}
CLOUDFRONT_DOMAIN: {{ .Values.backend.config.cloudfrontDomain | quote }}
CLOUDFRONT_KEY_PAIR_ID: {{ .Values.backend.config.cloudfrontKeyPairId | quote }}
LOCAL_UPLOAD_BASE_URL: {{ .Values.backend.config.localUploadBaseUrl | quote }}
{{- if not .Values.postgres.external.enabled }}
# --- PostgreSQL (consumed by the backend to build DATABASE_URL) ---
POSTGRES_DB: {{ .Values.postgres.database | quote }}
POSTGRES_USER: {{ .Values.postgres.user | quote }}
{{- end }}