init_db() now creates the parent directory for the SQLite database file before connecting. Also sets HAPROXY_DB_FILE in the K8s deployment to /app/data/ since the container doesn't have /opt/haproxy/conf/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
74 lines
1.8 KiB
YAML
74 lines
1.8 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: haproxy-mcp
|
|
namespace: default
|
|
labels:
|
|
app: haproxy-mcp
|
|
spec:
|
|
revisionHistoryLimit: 2
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: haproxy-mcp
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: haproxy-mcp
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: gitea-registry
|
|
containers:
|
|
- name: haproxy-mcp
|
|
image: gitea.anvil.it.com/kaffa/haproxy-mcp:latest
|
|
ports:
|
|
- containerPort: 8000
|
|
protocol: TCP
|
|
env:
|
|
- name: MCP_HOST
|
|
value: "0.0.0.0"
|
|
- name: MCP_PORT
|
|
value: "8000"
|
|
- name: HAPROXY_HOST
|
|
value: "100.108.39.107"
|
|
- name: HAPROXY_PORT
|
|
value: "9999"
|
|
- name: SSH_HOST
|
|
value: "100.108.39.107"
|
|
- name: SSH_USER
|
|
value: "root"
|
|
- name: SSH_KEY
|
|
value: "/root/.ssh/id_rsa"
|
|
- name: SSH_PORT
|
|
value: "22"
|
|
- name: HAPROXY_DB_FILE
|
|
value: "/app/data/haproxy_mcp.db"
|
|
- name: LOG_LEVEL
|
|
value: "INFO"
|
|
volumeMounts:
|
|
- name: ssh-key
|
|
mountPath: /root/.ssh
|
|
readOnly: true
|
|
readinessProbe:
|
|
tcpSocket:
|
|
port: 8000
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
tcpSocket:
|
|
port: 8000
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 30
|
|
resources:
|
|
requests:
|
|
memory: "128Mi"
|
|
cpu: "100m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "500m"
|
|
volumes:
|
|
- name: ssh-key
|
|
secret:
|
|
secretName: haproxy-ssh-key
|
|
defaultMode: 0600
|