Skip to content
Draft
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
11 changes: 10 additions & 1 deletion charts/flagsmith/templates/jobs-migrate-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,16 @@ spec:
{{- else }}
args: ["migrate"]
{{- end }}
env: {{ include (print $.Template.BasePath "/_api_environment.yaml") . | nindent 8 }}
env:
{{- include (print $.Template.BasePath "/_api_environment.yaml") . | nindent 8 }}
{{- if and .Values.jobs.migrateDb.databaseUrl .Values.jobs.migrateDb.databaseUrl.fromExistingSecret.enabled }}
{{- /* Override DATABASE_URL with migration-specific credentials */}}
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: {{ .Values.jobs.migrateDb.databaseUrl.fromExistingSecret.name | required "jobs.migrateDb.databaseUrl.fromExistingSecret.name is required when enabled" }}
key: {{ .Values.jobs.migrateDb.databaseUrl.fromExistingSecret.key | required "jobs.migrateDb.databaseUrl.fromExistingSecret.key is required when enabled" }}
{{- end }}
{{- with .Values.jobs.migrateDb.extraContainers }}
{{ if typeIs "string" . }}
{{- tpl . $ | nindent 6 }}
Expand Down
11 changes: 11 additions & 0 deletions charts/flagsmith/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,17 @@ jobs:
extraVolumes: []
command: []
args: []
# Use separate database credentials for migrations.
# This allows the migration job to run with elevated privileges (e.g., CREATE,
# ALTER, DROP for schema modifications) while the main application uses
# restricted credentials (e.g., SELECT, INSERT, UPDATE, DELETE only).
# This improves security by not granting schema modification privileges to
# the running application.
databaseUrl:
fromExistingSecret:
enabled: false
name: null
key: null
migrateAnalyticsData:
enabled: false
args: []
Expand Down
Loading