Phase 1: Service scaffold + deploy #1
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
plan-pal-e-mail→ Phase 1Repo
forgejo_admin/pal-e-mail(primary),forgejo_admin/pal-e-services(terraform),forgejo_admin/pal-e-deployments(kustomize)User Story
As a platform operator
I want an empty pal-e-mail FastAPI service deployed in the cluster
So that Phase 2 can add the send API on a running, healthy foundation
Context
pal-e-mail is a new platform-tier service that centralizes all email sending. This phase creates the empty shell: FastAPI app with
/healthz, Postgres for email_log, Gmail OAuth PVC (writable — fixing the read-only secret mount that broke token refresh in basketball-api), Woodpecker CI pipeline, and ArgoCD deployment via kustomize overlay.Key decisions: internal only (no Tailscale funnel —
funnel = false), own Postgres in namespace, writable PVC for Gmail tokens, port 8000, gmail-sdk-ldraney from Forgejo PyPI.File Targets
Files to create in
pal-e-mail:pyproject.toml— FastAPI, SQLAlchemy, alembic, gmail-sdk-ldraney, ruff dev depssrc/pal_e_mail/__init__.py— package initsrc/pal_e_mail/main.py— FastAPI app with /healthzsrc/pal_e_mail/config.py— settings (DATABASE_URL, GMAIL_SECRETS_DIR)src/pal_e_mail/models.py— EmailLog model (SQLAlchemy)src/pal_e_mail/database.py— engine + session setupDockerfile— 3-stage (base, builder, runtime), Forgejo PyPI extra-index-url.woodpecker.yaml— test + build-and-push via kanikoalembic.ini+alembic/— migration setupalembic/versions/001_email_log.py— initial migrationtests/test_healthz.py— healthz smoke testFiles to modify in
pal-e-services:terraform/k3s.tfvars— add pal-e-mail to services mapFiles to create in
pal-e-deployments:overlays/pal-e-mail/prod/kustomization.yaml— standard base + patchesoverlays/pal-e-mail/prod/deployment-patch.yaml— env vars, PVC mountsoverlays/pal-e-mail/prod/postgres.yaml— Postgres deployment + PVC + serviceoverlays/pal-e-mail/prod/pvc.yaml— gmail-oauth PVC (writable)Acceptance Criteria
/healthzreturns 200 from within cluster (kubectl exec)/secrets/gmailkubectl logsshows clean startup, no crash loopsTest Expectations
test_healthz.py— GET /healthz returns 200 with{"status": "ok"}pytest tests/Constraints
--extra-index-url https://forgejo.tail5b443a.ts.net/api/packages/forgejo_admin/pypi/simple/pal-e-mail/apifunnel = falsein k3s.tfvarsChecklist
Related
plan-pal-e-mail— parent planservice-onboarding-sop— deployment procedureconvention-kustomize-overlay— overlay pattern