Skip to content

App Deployments (4c-ii): cluster capacity accounting + footprint#222

Merged
v0l merged 1 commit into
masterfrom
feat/app-deployments-capacity
Jul 24, 2026
Merged

App Deployments (4c-ii): cluster capacity accounting + footprint#222
v0l merged 1 commit into
masterfrom
feat/app-deployments-capacity

Conversation

@v0l

@v0l v0l commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Second half of capacity management — the order-time admission counterpart to the operator's per-namespace ResourceQuota (#221).

Schema

  • app gains cpu_milli / memory_bytes / storage_bytes (its footprint).
  • app_cluster gains static admin-set capacity_cpu_milli / capacity_memory_bytes / capacity_storage_bytes (1:1, no overcommit; a 0-capacity cluster accepts nothing).

Admin

  • The app footprint is computed from the compose (lnvps_compose::footprint = Σ service resources + volume sizes) and stored on POST/PATCH /api/admin/v1/apps.
  • Cluster capacity_* are settable on POST/PATCH /api/admin/v1/app_clusters.
  • Both are returned on AdminAppInfo / AdminAppClusterInfo.

AppClusterCapacityService (lnvps_api_common, mirrors HostCapacityService)

used / available / fits / select_in_region, where available = capacity − Σ footprint(non-deleted deployments). Unit-tested via MockDb.

Tests / docs

  • MockDb capacity test (used/available/fits/region-selection incl. full + wrong-region).
  • e2e admin test now asserts the computed app footprint + cluster capacity echo.
  • ADMIN_API_ENDPOINTS.md + API_CHANGELOG.md.

Next

3b) customer ordering — validate config, run capacity admission via select_in_region, then create the subscription + line item + invoice.

Capacity increment (part 2): order-time admission counterpart to the
operator's per-namespace ResourceQuota.

- DB: app gains cpu_milli/memory_bytes/storage_bytes (its footprint);
  app_cluster gains static admin-set capacity_* columns (1:1, no
  overcommit). Migration + model + mysql + mock.
- Admin: the app footprint is computed from the compose
  (lnvps_compose::footprint = sum service resources + volume sizes) and
  stored on create/update; capacity_* settable on cluster create/update;
  both surfaced on AdminAppInfo / AdminAppClusterInfo.
- AppClusterCapacityService (lnvps_api_common, mirrors HostCapacityService):
  used / available / fits / select_in_region, where available = capacity −
  Σ footprint of non-deleted deployments. Unit-tested via MockDb.
- e2e admin test asserts computed footprint + capacity echo.

Consumed at order time by the customer ordering flow (3b, next).
Part of work/app-deployments.md.
@v0l
v0l merged commit 4e4301e into master Jul 24, 2026
8 checks passed
@v0l
v0l deleted the feat/app-deployments-capacity branch July 24, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant