mirror of
https://github.com/shadoll/helm-charts.git
synced 2026-10-12 21:59:18 +00:00
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.
79 lines
2.6 KiB
YAML
79 lines
2.6 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ .Release.Name }}
|
|
labels:
|
|
app.kubernetes.io/name: {{ .Chart.Name }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
|
app.kubernetes.io/component: mcp
|
|
app.kubernetes.io/part-of: postgres
|
|
annotations:
|
|
version-source: {{ index .Chart.Annotations "version-source" }}
|
|
version-pattern: {{ index .Chart.Annotations "version-pattern" | quote }}
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
# Not RollingUpdate: two pods would both hold live connections against
|
|
# the same shared mcp_agent role/config at once, doubling connection
|
|
# count and audit-log writers for no benefit -- this server has no
|
|
# per-replica state to preserve, so a brief gap during redeploy is fine.
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app: {{ .Release.Name }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: {{ .Release.Name }}
|
|
spec:
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
ports:
|
|
- containerPort: {{ .Values.port }}
|
|
name: http
|
|
protocol: TCP
|
|
env:
|
|
{{- range $key, $value := .Values.env }}
|
|
- name: {{ $key }}
|
|
value: {{ $value | quote }}
|
|
{{- end }}
|
|
{{- if .Values.auditLog.enabled }}
|
|
- name: DB_MCP_AUDIT_LOG
|
|
value: {{ .Values.auditLog.path | quote }}
|
|
{{- end }}
|
|
volumeMounts:
|
|
{{- if .Values.existingSecret }}
|
|
- name: db-config
|
|
mountPath: /app/config.json
|
|
subPath: {{ .Values.secretConfigKey }}
|
|
readOnly: true
|
|
{{- end }}
|
|
{{- if .Values.auditLog.enabled }}
|
|
- name: audit-log
|
|
mountPath: {{ .Values.auditLog.dir }}
|
|
{{- end }}
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
volumes:
|
|
{{- if .Values.existingSecret }}
|
|
- name: db-config
|
|
secret:
|
|
secretName: {{ .Values.existingSecret }}
|
|
{{- end }}
|
|
{{- if .Values.auditLog.enabled }}
|
|
- name: audit-log
|
|
persistentVolumeClaim:
|
|
claimName: {{ .Release.Name }}-audit-log
|
|
{{- end }}
|