Skip to content
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

feat: make dsn optional #660

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion helm/charts/kratos/templates/cleanup-cron-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ spec:
- --config
- /etc/config/kratos.yaml
env:
{{- if not (empty ( include "kratos.dsn" . )) }}
{{- if .Values.kratos.config.dsn }}
- name: DSN
valueFrom:
secretKeyRef:
Expand Down
4 changes: 4 additions & 0 deletions helm/charts/kratos/templates/deployment-kratos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,13 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
{{- if .Values.kratos.config.dsn }}
- name: DSN
valueFrom:
secretKeyRef:
name: {{ include "kratos.secretname" . }}
key: dsn
{{- end }}
{{- if $migrationExtraEnv }}
{{- toYaml $migrationExtraEnv | nindent 12 }}
{{- end }}
Expand Down Expand Up @@ -145,11 +147,13 @@ spec:
{{- end }}
{{- end }}
env:
{{- if .Values.kratos.config.dsn }}
- name: DSN
valueFrom:
secretKeyRef:
name: {{ include "kratos.secretname" . }}
key: dsn
{{- end }}
- name: SECRETS_DEFAULT
valueFrom:
secretKeyRef:
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/kratos/templates/job-migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ spec:
args: ["migrate", "sql", "-e", "--yes", "--config", "/etc/config/kratos.yaml"]
{{- end }}
env:
{{- if .Values.kratos.config.dsn }}
- name: DSN
valueFrom:
secretKeyRef:
name: {{ include "kratos.secretname" . }}
key: dsn
{{- end }}
{{- if $migrationExtraEnv }}
{{- toYaml $migrationExtraEnv | nindent 10 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/kratos/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ metadata:
{{- end }}
type: Opaque
data:
{{- if .Values.kratos.config.dsn }}
dsn: {{ include "kratos.dsn" . | b64enc | quote }}
{{- end }}
# Generate a random secret if the user doesn't give one. User given secret has priority
secretsDefault: {{ ( include "kratos.secrets.default" . | default ( randAlphaNum 32 )) | required "Value kratos.config.secrets.default can not be empty!" | b64enc | quote }}
secretsCookie: {{ ( include "kratos.secrets.cookie" . | default ( randAlphaNum 32 )) | required "Value kratos.config.secrets.cookie can not be empty!" | b64enc | quote }}
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/kratos/templates/statefulset-mail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ spec:
value: {{ .Values.statefulSet.log.format }}
- name: LOG_LEVEL
value: {{ .Values.statefulSet.log.level }}
{{- if .Values.kratos.config.dsn }}
- name: DSN
valueFrom:
secretKeyRef:
name: {{ include "kratos.secretname" . }}
key: dsn
{{- end }}
- name: SECRETS_DEFAULT
valueFrom:
secretKeyRef:
Expand Down