feat: add PostgreSQL tuner (pgtuner) MCP sidecar
- Add pgtuner MCP sidecar configuration (disabled by default) - Supports PostgreSQL performance tuning and optimization - Analyzes slow queries, recommends indexes, detects bloat - Requires DATABASE_URI secret to be configured - Runs in SSE mode on port 8085 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -1,5 +1,12 @@
|
|||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
|
"github": {
|
||||||
|
"type": "http",
|
||||||
|
"url": "https://api.githubcopilot.com/mcp/",
|
||||||
|
"headers": {
|
||||||
|
"Authorization": "Bearer ${GITHUB_TOKEN}"
|
||||||
|
}
|
||||||
|
},
|
||||||
"kubernetes": {
|
"kubernetes": {
|
||||||
"type": "sse",
|
"type": "sse",
|
||||||
"url": "http://localhost:8080/sse"
|
"url": "http://localhost:8080/sse"
|
||||||
@@ -8,18 +15,14 @@
|
|||||||
"type": "sse",
|
"type": "sse",
|
||||||
"url": "http://localhost:8081/sse"
|
"url": "http://localhost:8081/sse"
|
||||||
},
|
},
|
||||||
"homeassistant": {
|
|
||||||
"type": "sse",
|
|
||||||
"url": "http://localhost:8087/sse"
|
|
||||||
},
|
|
||||||
"github": {
|
|
||||||
"type": "sse",
|
|
||||||
"url": "http://localhost:8088/sse"
|
|
||||||
},
|
|
||||||
"playwright": {
|
"playwright": {
|
||||||
"type": "sse",
|
"type": "sse",
|
||||||
"url": "http://playwright-mcp.playwright.svc.cluster.local:3000/sse"
|
"url": "http://playwright-mcp.playwright.svc.cluster.local:3000/sse"
|
||||||
}
|
},
|
||||||
|
"pgtuner": {
|
||||||
|
"type": "sse",
|
||||||
|
"url": "http://localhost:8085/sse"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -232,6 +232,40 @@ spec:
|
|||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.mcpSidecars.github.resources | nindent 12 }}
|
{{- toYaml .Values.mcpSidecars.github.resources | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.mcpSidecars.pgtuner.enabled }}
|
||||||
|
- name: pgtuner-mcp
|
||||||
|
image: "{{ .Values.mcpSidecars.pgtuner.image.repository }}:{{ .Values.mcpSidecars.pgtuner.image.tag }}"
|
||||||
|
imagePullPolicy: Always
|
||||||
|
command: ["python", "-m", "pgtuner_mcp", "--transport", "sse", "--port", "{{ .Values.mcpSidecars.pgtuner.port }}"]
|
||||||
|
ports:
|
||||||
|
- name: pgtuner
|
||||||
|
containerPort: {{ .Values.mcpSidecars.pgtuner.port }}
|
||||||
|
env:
|
||||||
|
- name: DATABASE_URI
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "antigravity.envSecretName" . }}
|
||||||
|
key: database-uri
|
||||||
|
optional: true
|
||||||
|
- name: PGTUNER_EXCLUDE_USERIDS
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "antigravity.envSecretName" . }}
|
||||||
|
key: pgtuner-exclude-userids
|
||||||
|
optional: true
|
||||||
|
livenessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: {{ .Values.mcpSidecars.pgtuner.port }}
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 10
|
||||||
|
readinessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: {{ .Values.mcpSidecars.pgtuner.port }}
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 5
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.mcpSidecars.pgtuner.resources | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
volumes:
|
volumes:
|
||||||
- name: workspace
|
- name: workspace
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
|
|||||||
@@ -121,3 +121,16 @@ mcpSidecars:
|
|||||||
limits:
|
limits:
|
||||||
memory: "256Mi"
|
memory: "256Mi"
|
||||||
cpu: "500m"
|
cpu: "500m"
|
||||||
|
pgtuner:
|
||||||
|
enabled: false # Disabled by default, requires DATABASE_URI in secrets
|
||||||
|
image:
|
||||||
|
repository: dog830228/pgtuner_mcp
|
||||||
|
tag: latest # TODO: pin to specific version once stable release available
|
||||||
|
port: 8085
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: "64Mi"
|
||||||
|
cpu: "50m"
|
||||||
|
limits:
|
||||||
|
memory: "256Mi"
|
||||||
|
cpu: "500m"
|
||||||
|
|||||||
Reference in New Issue
Block a user