58 lines
1.9 KiB
YAML
58 lines
1.9 KiB
YAML
{{- /*
|
|
TODO: Split env vars into separate secrets so that each pod
|
|
only gets passed the secrets it really needs.
|
|
*/}}
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: {{ include "ragflow.fullname" . }}-env-config
|
|
type: Opaque
|
|
stringData:
|
|
{{- range $key, $val := .Values.env }}
|
|
{{- if $val }}
|
|
{{ $key }}: {{ quote $val }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if not .Values.externalServices.mysql.enabled }}
|
|
{{- $mysqlCreds := default (dict) .Values.mysql.credentials }}
|
|
{{- with (get $mysqlCreds "password") }}
|
|
MYSQL_PASSWORD: {{ . | quote }}
|
|
MYSQL_ROOT_PASSWORD: {{ . | quote }}
|
|
{{- end }}
|
|
{{- with (get $mysqlCreds "name") }}
|
|
MYSQL_DBNAME: {{ . | quote }}
|
|
{{- end }}
|
|
{{- with (get $mysqlCreds "user") }}
|
|
MYSQL_USER: {{ . | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if not .Values.externalServices.redis.enabled }}
|
|
{{- $redisCreds := default (dict) .Values.redis.credentials }}
|
|
{{- with (get $redisCreds "password") }}
|
|
REDIS_PASSWORD: {{ . | quote }}
|
|
{{- end }}
|
|
{{- with (get $redisCreds "db") }}
|
|
REDIS_DB: {{ . | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if not .Values.externalServices.s3.enabled }}
|
|
{{- $minioCreds := default (dict) .Values.minio.credentials }}
|
|
{{- with (get $minioCreds "user") }}
|
|
MINIO_ROOT_USER: {{ . | quote }}
|
|
{{- end }}
|
|
{{- with (get $minioCreds "password") }}
|
|
MINIO_ROOT_PASSWORD: {{ . | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if not (hasKey .Values.env "STORAGE_IMPL") }}
|
|
STORAGE_IMPL: {{ if .Values.externalServices.s3.enabled }}"AWS_S3"{{ else }}"MINIO"{{ end }}
|
|
{{- end }}
|
|
{{- if and (eq (default "" .Values.env.DOC_ENGINE) "elasticsearch") (not .Values.externalServices.elasticsearch.enabled) }}
|
|
{{- $esCreds := default (dict) .Values.elasticsearch.credentials }}
|
|
{{- with (get $esCreds "username") }}
|
|
ELASTIC_USERNAME: {{ . | quote }}
|
|
{{- end }}
|
|
{{- with (get $esCreds "password") }}
|
|
ELASTIC_PASSWORD: {{ . | quote }}
|
|
{{- end }}
|
|
{{- end }}
|