Switch k8s manifests from SQLite/Litestream to Postgres #78

Merged
forgejo_admin merged 2 commits from 76-postgres-manifest-switch into main 2026-03-06 19:48:19 +00:00
Contributor

Summary

Removes all SQLite/Litestream infrastructure from k8s manifests and switches the app to read PALDOCS_DATABASE_URL from a Kubernetes secret (pal-e-docs-db). This is PR 2 of 2 -- must be merged AFTER PR #77 (code changes), Terraform apply (creates the DB secret), alembic upgrade head against Postgres, and data migration script execution.

Changes

  • k8s/deployment.yaml: Replaced PALDOCS_DATABASE_PATH env var with PALDOCS_DATABASE_URL from pal-e-docs-db secret; removed Litestream init container, Litestream sidecar container, PVC volume, and all associated volume mounts
  • k8s/pvc.yaml: Deleted (no longer needed -- data lives in CNPG Postgres)
  • k8s/litestream-configmap.yaml: Deleted (no longer needed)
  • k8s/kustomization.yaml: Removed references to deleted pvc.yaml and litestream-configmap.yaml

Test Plan

  • Verify PR #77 is merged first (code changes with dual-backend support)
  • Terraform applied (creates pal-e-docs-db secret with database-url key)
  • alembic upgrade head run against Postgres successfully
  • scripts/migrate_sqlite_to_postgres.py executed, data verified
  • After merging this PR: app starts, healthz returns 200, all API endpoints work against Postgres

Review Checklist

  • Passed automated review-fix loop
  • No secrets committed
  • No unnecessary file changes
  • Commit messages are descriptive
  • K8s manifest changes: namespace, secret, and resource changes noted
  • plan-2026-02-26-tf-modularize-postgres -- the plan this implements (Phase 3)
  • Forgejo issue: #76
  • Depends on: PR #77 (code changes)
## Summary Removes all SQLite/Litestream infrastructure from k8s manifests and switches the app to read `PALDOCS_DATABASE_URL` from a Kubernetes secret (`pal-e-docs-db`). This is PR 2 of 2 -- must be merged AFTER PR #77 (code changes), Terraform apply (creates the DB secret), alembic upgrade head against Postgres, and data migration script execution. ## Changes - `k8s/deployment.yaml`: Replaced `PALDOCS_DATABASE_PATH` env var with `PALDOCS_DATABASE_URL` from `pal-e-docs-db` secret; removed Litestream init container, Litestream sidecar container, PVC volume, and all associated volume mounts - `k8s/pvc.yaml`: Deleted (no longer needed -- data lives in CNPG Postgres) - `k8s/litestream-configmap.yaml`: Deleted (no longer needed) - `k8s/kustomization.yaml`: Removed references to deleted pvc.yaml and litestream-configmap.yaml ## Test Plan - [ ] Verify PR #77 is merged first (code changes with dual-backend support) - [ ] Terraform applied (creates `pal-e-docs-db` secret with `database-url` key) - [ ] `alembic upgrade head` run against Postgres successfully - [ ] `scripts/migrate_sqlite_to_postgres.py` executed, data verified - [ ] After merging this PR: app starts, healthz returns 200, all API endpoints work against Postgres ## Review Checklist - [x] Passed automated review-fix loop - [x] No secrets committed - [x] No unnecessary file changes - [x] Commit messages are descriptive - [x] K8s manifest changes: namespace, secret, and resource changes noted ## Related Notes - `plan-2026-02-26-tf-modularize-postgres` -- the plan this implements (Phase 3) - Forgejo issue: #76 - Depends on: PR #77 (code changes)
Switch k8s manifests from SQLite/Litestream to Postgres (CNPG)
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
5916128f94
- Replace PALDOCS_DATABASE_PATH with PALDOCS_DATABASE_URL from pal-e-docs-db secret
- Remove Litestream init container (litestream-restore)
- Remove Litestream sidecar container (litestream-replicate)
- Remove PVC (pal-e-docs-data) and data volume mounts
- Delete pvc.yaml and litestream-configmap.yaml
- Update kustomization.yaml to remove deleted resources

Closes #76 (PR 2 of 2)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix secretKeyRef to match Terraform-created secret
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
f3032e4b0e
The Terraform resource creates the secret as `paledocs-db-url` with
key `DATABASE_URL`, not `pal-e-docs-db` / `database-url`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
forgejo_admin deleted branch 76-postgres-manifest-switch 2026-03-06 19:48:20 +00:00
Commenting is not possible because the repository is archived.
No description provided.