OpenClaw runs in WSL for direct system access, while data persists in a PostgreSQL database running in the Kubernetes cluster.
┌────────────────────────────────────────────────────────────────────────────┐
│ WSL Environment │
│ │
│ ┌──────────────────────────────────────────────────────────────────────┐ │
│ │ OpenClaw Gateway │ │
│ │ │ │
│ │ • Manages conversations │ │
│ │ • Executes shell commands │ │
│ │ • Direct filesystem access │ │
│ │ • Runs cron jobs / heartbeats │ │
│ └───────────────────────────┬──────────────────────────────────────────┘ │
│ │ │
│ ┌───────────────────────────▼──────────────────────────────────────────┐ │
│ │ Docker (one-off) │ │
│ │ │ │
│ │ docker run --rm --add-host=host.docker.internal:host-gateway \ │ │
│ │ -e PT_DB_HOST=host.docker.internal \ │ │
│ │ moltbot-helpers-quick:latest pt --project openclaw list │ │
│ │ │ │
│ └───────────────────────────┬──────────────────────────────────────────┘ │
│ │ │
│ ┌───────────────────────────▼──────────────────────────────────────────┐ │
│ │ kubectl port-forward │ │
│ │ │ │
│ │ kubectl port-forward service/postgres-service 5433:5432 -n default │ │
│ │ (runs as background process) │ │
│ └───────────────────────────┬──────────────────────────────────────────┘ │
│ │ │
└──────────────────────────────┼─────────────────────────────────────────────┘
│
┌──────────────────────────────▼─────────────────────────────────────────────┐
│ Kubernetes (openclaw-cluster) │
│ │
│ ┌──────────────────────────────────────────────────────────────────────┐ │
│ │ PostgreSQL (postgres-service) │ │
│ │ │ │
│ │ Database: financial_analysis │ │
│ │ User: finance_user │ │
│ │ │ │
│ │ Tables: │ │
│ │ ├── project_tracker (pt tool) │ │
│ │ ├── fp_* (fp tool - family planner) │ │
│ │ └── seek_* (seek tool - semantic search) │ │
│ └──────────────────────────────────────────────────────────────────────┘ │
│ │
└────────────────────────────────────────────────────────────────────────────┘
- OpenClaw receives a request (e.g., "add a task to the roadmap")
- OpenClaw runs a Docker container with
moltbot-helpers-quick - Docker connects to
host.docker.internal:5433 - Port-forward routes traffic to PostgreSQL in the K8s cluster
- PostgreSQL stores/retrieves data
- Result flows back to OpenClaw
# List project tasks
docker run --rm --add-host=host.docker.internal:host-gateway \
-e PT_DB_HOST=host.docker.internal \
moltbot-helpers-quick:latest pt --project openclaw list
# Add a task
docker run --rm --add-host=host.docker.internal:host-gateway \
-e PT_DB_HOST=host.docker.internal \
moltbot-helpers-quick:latest pt --project openclaw add \
-c roadmap -t "New feature" --priority high
# Family planner
docker run --rm --add-host=host.docker.internal:host-gateway \
-e PT_DB_HOST=host.docker.internal \
moltbot-helpers-quick:latest fp tasks# Ensure port-forward is running
kubectl port-forward service/postgres-service 5433:5432 -n default &
# Install locally
cd ~/projects/moltbot-helpers
pip install -e .
# Use directly
pt --project openclaw list
fp tasks
seek search "kubernetes"-
Start the K8s cluster if not running:
k3d cluster list k3d cluster start openclaw-cluster
-
Start port-forward (keep running in background):
kubectl port-forward service/postgres-service 5433:5432 -n default & -
OpenClaw is now ready to use tools
Run once after cluster creation:
docker run --rm --add-host=host.docker.internal:host-gateway \
-e PT_DB_HOST=host.docker.internal \
moltbot-helpers-quick:latest python3 scripts/init_db.py| Component | Location | Reason |
|---|---|---|
| OpenClaw Gateway | WSL | Direct access to filesystem, shell, system |
| PostgreSQL | K8s cluster | Persistent, isolated, scalable |
| CLI Tools | Docker | Consistent environment, no local deps |
# Check if running
pgrep -f "port-forward.*postgres"
# Restart
kubectl port-forward service/postgres-service 5433:5432 -n default &# Test connection
docker run --rm --add-host=host.docker.internal:host-gateway \
-e PT_DB_HOST=host.docker.internal \
moltbot-helpers-quick:latest python3 -c \
"import psycopg2; psycopg2.connect(host='host.docker.internal', port=5433, database='financial_analysis', user='finance_user', password='secure_finance_password'); print('OK')"k3d cluster list
k3d cluster start openclaw-cluster