Skip to content

Enhancement of PostgreSQL Secret Management to Improve GitOps Practices #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 7 additions & 1 deletion charts/mageai/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,15 @@ spec:
- name: REDIS_URL
value: {{ .Values.redis.customRedisURL }}
{{- end }}
{{- if .Values.postgresql.enabled }}
{{- if and .Values.postgresql.enabled .Values.postgresql.auth.password }}
- name: MAGE_DATABASE_CONNECTION_URL
value: postgresql://{{ .Values.postgresql.auth.username }}:{{ .Values.postgresql.auth.password }}@{{ .Values.postgresql.fullnameOverride }}:5432/{{ .Values.postgresql.auth.database }}
{{- else if and .Values.postgresql.enabled .Values.postgresql.auth.existingSecret }}
- name: MAGE_DATABASE_CONNECTION_URL
valueFrom:
secretKeyRef:
name: {{ .Values.postgresql.auth.existingSecret }}
key: {{ .Values.postgresql.auth.secretKeys.connectionStringKey }}
{{- end }}
volumeMounts:
{{- if .Values.volumes }}
Expand Down
18 changes: 16 additions & 2 deletions charts/mageai/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,23 @@ postgresql:
enabled: false
fullnameOverride: "postgresql-service"
auth:
username: your_username
password: your_password
database: your_database
username: your_username

# either specify the password in cleartext (not recommended for gitops) or use an existing secret
# defining a cleartext password will override the secret

# password: your_password

# Use an existing secret for the password
existingSecret: ""
# the keys in the secret to use
secretKeys:
adminPasswordKey: "adminPassword"
userPasswordKey: "userPassword"
replicationPasswordKey: "replicationPassword"
# the connection string needs to match the database name and username defined above
connectionStringKey: connectionString # postgresql://your_username:your_password@postgresql-service:5432/your_database

# Enable redis if you want more replica
redis:
Expand Down