Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz Source: /opt/alga-psa on psa.joliet.tech
3.6 KiB
Talos Appliance GitOps Alga Deployment Design
- Date:
2026-03-10 - Status: Approved
Summary
Deploy Alga PSA on the Talos appliance through Flux-managed GitOps instead of direct first-boot Helm commands. The appliance should reconcile a single-node on-prem stack that includes the Alga server, Postgres, PgBouncer, Redis, Hocuspocus, email-service, workflow-worker, Temporal, and temporal-worker. Initial startup must bootstrap the database and run seeds once. Later restarts or Flux reconciliations must reuse existing PVC-backed state and must not reseed the database.
Architecture
Talos first boot owns cluster bootstrap and Flux bootstrap only. Application installation is owned by Flux from an appliance-specific path in this repository.
Namespaces:
flux-system: Flux controllers and bootstrap objects.alga-system: appliance coordination objects when needed.msp: Alga PSA runtime workloads, keeping compatibility with the existing Helm defaults.
Release boundaries:
temporal: Temporal server/frontend persistence stack.alga-core: roothelm/chart, owning server, Postgres, Redis, Hocuspocus, and bootstrap/migration behavior.pgbouncer: new Kubernetes deployment path for PgBouncer.workflow-worker: existingee/helm/workflow-workerchart.email-service: existingee/helm/email-servicechart.temporal-worker: existingee/helm/temporal-workerchart.
Ordering:
- Talos boots Kubernetes.
- First-boot logic installs Flux and points it at the appliance profile.
- Flux reconciles namespaces, repositories, and values ConfigMaps.
- Flux reconciles
temporalandalga-core. - Flux reconciles
pgbouncer,workflow-worker,email-service, andtemporal-worker.
Bootstrap And Idempotency
Initial install must be treated as "database not initialized" rather than "Helm release install." The current Compose setup already follows that model through setup/entrypoint.sh.
Desired behavior:
- Postgres PVC comes up.
- A pre-install/pre-upgrade bootstrap job runs from the setup image.
- The bootstrap job creates databases/users idempotently, runs migrations, checks whether seed data already exists, and only runs seeds when the database is still empty.
- Application pods start only after the bootstrap job succeeds.
Implications:
- Migrations are safe to run on upgrades.
- Seeds are guarded by database state and do not rerun on ordinary restart or release reconciliation.
- Recreating a Helm release against an existing PVC-backed database is safe because the job rechecks DB state before seeding.
Implementation Shape
Repository additions:
ee/appliance/flux/base/ee/appliance/flux/profiles/talos-single-node/ee/appliance/flux/profiles/talos-single-node/values/*.yamlhistorical removed bootstrap wrapperee/appliance/scripts/deploy-app.shee/helm/pgbouncer/
Key chart changes:
- Replace the current split migration/seed Helm hook behavior in the root chart with one idempotent bootstrap hook that reuses the setup image and setup script semantics.
- Preserve generated DB credentials across Helm reconciliations instead of rotating them on reinstall.
- Add root-chart support for routing the server through PgBouncer while bootstrap still targets direct Postgres.
Validation
Required validation:
helm templatesucceeds foralga-corewith the Talos single-node overlay.helm templatesucceeds forpgbouncer,workflow-worker,email-service, andtemporal-worker.- Fresh install runs bootstrap once, seeds once, and all core workloads become Ready.
- Restart or no-op Flux reconciliation does not trigger reseeding and continues to use existing PVC-backed state.