mirror of
https://github.com/shadoll/helm-charts.git
synced 2026-10-13 06:09:16 +00:00
Fix postgres-mcp: mount config as file, not DB_CONFIG env var
The freepeak/db-mcp-server image ships a baked-in CONFIG_PATH pointing at its own bundled sample config; a same-named env var does not take priority over an existing file at that path, so DB_CONFIG was silently ignored and the server came up serving the sample databases instead of ours. Mount the real config as a file at /app/config.json instead.
This commit is contained in:
@@ -48,26 +48,30 @@ spec:
|
|||||||
- name: {{ $key }}
|
- name: {{ $key }}
|
||||||
value: {{ $value | quote }}
|
value: {{ $value | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.existingSecret }}
|
|
||||||
- name: DB_CONFIG
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: {{ .Values.existingSecret }}
|
|
||||||
key: {{ .Values.secretConfigKey }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.auditLog.enabled }}
|
{{- if .Values.auditLog.enabled }}
|
||||||
- name: DB_MCP_AUDIT_LOG
|
- name: DB_MCP_AUDIT_LOG
|
||||||
value: {{ .Values.auditLog.path | quote }}
|
value: {{ .Values.auditLog.path | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.auditLog.enabled }}
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
{{- if .Values.existingSecret }}
|
||||||
|
- name: db-config
|
||||||
|
mountPath: /app/config.json
|
||||||
|
subPath: {{ .Values.secretConfigKey }}
|
||||||
|
readOnly: true
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.auditLog.enabled }}
|
||||||
- name: audit-log
|
- name: audit-log
|
||||||
mountPath: {{ .Values.auditLog.dir }}
|
mountPath: {{ .Values.auditLog.dir }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
{{- if .Values.auditLog.enabled }}
|
|
||||||
volumes:
|
volumes:
|
||||||
|
{{- if .Values.existingSecret }}
|
||||||
|
- name: db-config
|
||||||
|
secret:
|
||||||
|
secretName: {{ .Values.existingSecret }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.auditLog.enabled }}
|
||||||
- name: audit-log
|
- name: audit-log
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: {{ .Release.Name }}-audit-log
|
claimName: {{ .Release.Name }}-audit-log
|
||||||
|
|||||||
@@ -5,16 +5,22 @@ image:
|
|||||||
|
|
||||||
port: 9092
|
port: 9092
|
||||||
|
|
||||||
# Name of a Secret holding the whole multi-database config as one JSON blob
|
# Name of a Secret holding the whole multi-database config as one JSON blob,
|
||||||
# (see FreePeak/db-mcp-server's DB_CONFIG env var) -- keeps connection
|
# mounted as a file at /app/config.json (the image's own CONFIG_PATH
|
||||||
# strings/passwords for every database out of a plain ConfigMap.
|
# default) -- overriding it by file, not the DB_CONFIG env var, because the
|
||||||
|
# image ships a baked-in CONFIG_PATH pointing at its own sample config,
|
||||||
|
# which a same-named env var does NOT take priority over (file always wins;
|
||||||
|
# confirmed empirically -- DB_CONFIG alone silently loaded the sample DBs
|
||||||
|
# instead of ours). Keeps connection strings/passwords for every database
|
||||||
|
# out of a plain ConfigMap.
|
||||||
existingSecret: ""
|
existingSecret: ""
|
||||||
secretConfigKey: "DB_CONFIG"
|
secretConfigKey: "config.json"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
TRANSPORT_MODE: "sse"
|
TRANSPORT_MODE: "sse"
|
||||||
SERVER_PORT: "9092"
|
SERVER_PORT: "9092"
|
||||||
LOG_LEVEL: "info"
|
LOG_LEVEL: "info"
|
||||||
|
CONFIG_PATH: "/app/config.json"
|
||||||
|
|
||||||
# Persistent audit log (DB_MCP_AUDIT_LOG) -- one JSONL record per executed
|
# Persistent audit log (DB_MCP_AUDIT_LOG) -- one JSONL record per executed
|
||||||
# statement, including rejected writes against read-only databases. Kept on
|
# statement, including rejected writes against read-only databases. Kept on
|
||||||
|
|||||||
Reference in New Issue
Block a user