Add postgres-mcp Helm chart

Wraps FreePeak/db-mcp-server: multi-database Postgres MCP driven by a
single JSON connection list, so new databases don't need a new Helm
release. Includes per-connection read_only/max_rows/query_timeout/
masking_rules guardrails and a PVC-backed audit log.
This commit is contained in:
sha
2026-08-30 00:24:14 +03:00
parent 88d5ec6773
commit 58671bda88
6 changed files with 190 additions and 0 deletions
+74
View File
@@ -0,0 +1,74 @@
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.existingSecret }}
- name: DB_CONFIG
valueFrom:
secretKeyRef:
name: {{ .Values.existingSecret }}
key: {{ .Values.secretConfigKey }}
{{- end }}
{{- if .Values.auditLog.enabled }}
- name: DB_MCP_AUDIT_LOG
value: {{ .Values.auditLog.path | quote }}
{{- end }}
{{- if .Values.auditLog.enabled }}
volumeMounts:
- name: audit-log
mountPath: {{ .Values.auditLog.dir }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.auditLog.enabled }}
volumes:
- name: audit-log
persistentVolumeClaim:
claimName: {{ .Release.Name }}-audit-log
{{- end }}
+27
View File
@@ -0,0 +1,27 @@
{{- range $name, $config := .Values.ingresses }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $.Release.Name }}-{{ $name }}
{{- with $config.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
rules:
- host: {{ $config.host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ $.Release.Name }}
port:
number: {{ $.Values.port }}
{{- with $config.tls }}
tls:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
+13
View File
@@ -0,0 +1,13 @@
{{- if .Values.auditLog.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Release.Name }}-audit-log
spec:
accessModes:
- ReadWriteOnce
storageClassName: {{ .Values.auditLog.storageClass }}
resources:
requests:
storage: {{ .Values.auditLog.size }}
{{- end }}
+16
View File
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
labels:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
type: ClusterIP
selector:
app: {{ .Release.Name }}
ports:
- name: http
port: {{ .Values.port }}
targetPort: http
protocol: TCP