diff --git a/haproxy_mcp/db.py b/haproxy_mcp/db.py index ec7caa5..e0d2a77 100644 --- a/haproxy_mcp/db.py +++ b/haproxy_mcp/db.py @@ -63,6 +63,11 @@ def init_db() -> None: Creates tables if they don't exist, then checks for existing JSON/map files to migrate data from. """ + # Ensure parent directory exists for the database file + db_dir = os.path.dirname(DB_FILE) + if db_dir: + os.makedirs(db_dir, exist_ok=True) + conn = get_connection() cur = conn.cursor() diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 0a5a5ec..f0b959a 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -41,6 +41,8 @@ spec: 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: