App Deployments (1/N): DB foundation — catalog, clusters, deployments#214
Merged
Conversation
Increment 1 of the managed App Deployments epic (predefined apps on shared
k8s infra). Pure DB layer, no API/operator yet.
- Migrations add three tables:
- app: catalog of predefined apps, each defined by a docker-compose-style
YAML blob (image/ports/env/volumes) + inline subscription pricing.
- app_cluster: a k8s cluster, linked to a region (location + billing
company); carries the ingress base domain. No kube credentials stored.
- app_deployment: a user's instance, billed via the subscription engine
(subscription_line_item_id) and reconciled into its own namespace.
- SubscriptionType::App = 4 and ApiSubscriptionLineItemResource::App so app
deployments flow through the existing subscription/billing engine like VMs.
- Model structs + status/desired-state enums; config stored as an encrypted
JSON blob (EncryptedString) so secret env values are protected at rest.
- DB trait methods + mysql + MockDb impls; unit tests for catalog, cluster
and deployment CRUD (incl. per-user vs operator listing, line-item
resolution, status write-back, soft delete).
Part of work/app-deployments.md.
v0l
force-pushed
the
feat/app-deployments-db
branch
from
July 24, 2026 12:17
406be06 to
4132ca4
Compare
This was referenced Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First increment of the managed App Deployments epic (see
work/app-deployments.md): predefined apps (Nostr relay, Blossom, …) run on shared Kubernetes infra — no per-user VMs, no IP-space usage. This PR is the DB layer only (no API/operator yet).Design (agreed)
SubscriptionType::App = 4; deployments link viasubscription_line_item_idlike VMs.app_cluster, which references a neutralregion(location + billing company) — decoupled from VM infra (see thevm_host_region → regionrename in refactor(db): rename vm_host_region → region (internal, API stable) #213). The in-cluster operator is keyed bycluster_id; no kube credentials in the DB.This PR
app,app_cluster,app_deployment(cluster FK →region).SubscriptionType::App+ApiSubscriptionLineItemResource::App.configstored as an encrypted JSON blob (EncryptedString).Next increments