Infra: Postgres database + NetworkPolicy for interaction logging #21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
Prerequisite for forgejo_admin/westside-ai-assistant#19 (interaction logging). Discovered during review-684-2026-03-28-v2.
Repo
forgejo_admin/pal-e-platform+ cluster opsUser Story
As Lucas (platform operator)
I want a Postgres database provisioned for Nemo's interaction logs
So that the AI assistant can persist conversation data for analysis and improvement
Context
The westside-ai-assistant needs a database in the existing CNPG cluster (pal-e-postgres) for interaction logging. Three things needed: (1) create a database + user in the CNPG Postgres cluster, (2) add westside-ai-assistant to the postgres NetworkPolicy allowlist in pal-e-platform, (3) create a k8s secret with the database URL in the westside-ai-assistant namespace.
File Targets
Files the agent should modify:
terraform/network-policies.tf— addwestside-ai-assistantto postgres namespace NetworkPolicy allowlist (same pattern as basketball-api)Files the agent should NOT touch:
Acceptance Criteria
nemocreated in pal-e-postgres CNPG cluster:kubectl exec -n postgres pal-e-postgres-1 -- psql -U postgres -c "CREATE DATABASE nemo;"nemocreated with password:kubectl exec -n postgres pal-e-postgres-1 -- psql -U postgres -c "CREATE USER nemo WITH PASSWORD '...'; GRANT ALL ON DATABASE nemo TO nemo;"kubectl create secret generic nemo-db-secrets -n westside-ai-assistant --from-literal=database-url="postgresql://nemo:PASSWORD@pal-e-postgres-rw.postgres.svc.cluster.local:5432/nemo"tofu plan -lock=falseshows only NetworkPolicy changeTest Expectations
tofu validatepassestofu plan -lock=falseoutput in PRpsql $DATABASE_URL -c "SELECT 1"connects successfullycd terraform && tofu validate && tofu plan -lock=falseConstraints
Checklist
Related
project-westside-ai-assistant— parent project