App Deployments (3b): customer ordering + lifecycle#223
Merged
Conversation
Increment 3b of the App Deployments epic. Customers can now deploy apps. - POST /api/v1/app-deployments: validate DNS-safe name + config (against the app's compose config schema), admit against the region's cluster capacity (AppClusterCapacityService::select_in_region), then create a Subscription + App line item + the deployment (pending). Config stored encrypted. Activated by paying the subscription via the standard flow — the renew engine already bills flat non-VPS line items, so App needs no special case. - DELETE: deactivate the subscription (stop billing) + soft-delete (operator GCs the namespace/volumes). PATCH .../stop|start toggle desired_state. All ownership-checked. - Operator: only run paid (subscription is_setup) + unexpired deployments, so an unpaid new order stays at 0 replicas until paid. - Unit tests (validate_deployment_name, resolve_config) + e2e ordering test (order, name/config/capacity rejection, stop/start, delete). Docs + changelog. Part of work/app-deployments.md.
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.
The customer-facing ordering flow — the payment-integrated core of the epic. Builds on the read-only API (#217), capacity (#222), and operator reconcile (#220).
Endpoints
/api/v1/app-deployments—{ app_id, name, region_id, config }. Validates the DNS-safenameand theconfigagainst the app's composeconfigschema (required present, unknown rejected, defaults filled), admits it against the region's cluster capacity (select_in_region), then creates a Subscription +Appline item + the deployment (pending). Config is stored encrypted./api/v1/app-deployments/{id}/stop|start— toggledesired_state(stop scales to 0, data retained)./api/v1/app-deployments/{id}— deactivate the subscription (stop billing) + soft-delete (operator GCs the namespace/volumes).Billing
Reuses the existing subscription engine — the renew flow already bills flat non-VPS line items, so
Appneeds no special case. A new order is pending/unpaid; the customer pays via/api/v1/subscriptions/{id}/renew. The operator only runs paid (is_setup) + unexpired deployments, so an unpaid order stays at 0 replicas until paid.Tests / docs
validate_deployment_name,resolve_config(required/unknown/default/override).Next