Skip to content

App Deployments (4b/N): operator reconcile into Kubernetes#220

Merged
v0l merged 2 commits into
masterfrom
feat/app-deployments-operator-reconcile
Jul 24, 2026
Merged

App Deployments (4b/N): operator reconcile into Kubernetes#220
v0l merged 2 commits into
masterfrom
feat/app-deployments-operator-reconcile

Conversation

@v0l

@v0l v0l commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Increment 4b of the managed App Deployments epic (see work/app-deployments.md). The lnvps_operator now renders app_deployment rows (for its configured cluster) into Kubernetes, using the shared lnvps_compose parser (#218/#219).

Object builders (pure, unit-tested — 13 tests)

  • Namespace per deployment, labelled for the restricted Pod Security Standard.
  • Default-deny NetworkPolicy (ingress+egress).
  • Deployment per compose service with a locked-down container securityContext (non-root, drop ALL caps, no privilege escalation, read-only rootfs) + pod-level non-root/seccomp; Recreate strategy; PVCs mounted read-write and files: mounted read-only via subPath.
  • ClusterIP Service named after the compose service (so intra-namespace DNS matches mariadb:3306 refs).
  • PVCs for volumes:; ConfigMap (non-sensitive files) / Secret (generated secrets + sensitive files).
  • Ingress (cert-manager TLS) for the single expose: ingress port.

Reconcile

reconcile_app_deployments(ctx) — gated on a new operator app_cluster_id config; for each deployment: server-side apply all objects, resolve ${…} env+files against generated secrets (created once, stored in a namespace generated Secret so values stay stable) + customer config, write back status/hostname, and GC namespaces for removed/deleted deployments. Wired into the operator's initial + periodic loop. Net effect: the customer AppDeployment.status/hostname now populate once provisioned.

Deferred

The ResourceQuota builder is present but not applied yet — a limits.* quota requires containers to carry resource limits, which arrive with the capacity increment (4c) along with per-service resources:, the app footprint, static per-cluster capacity, and an AppClusterCapacityService for order-time admission.

Next

4c) capacity management · 3b) customer ordering (subscription + invoice) · 5) seed strfry/HAVEN/route96/Blossom.

v0l added 2 commits July 24, 2026 16:56
Increment 4b of the App Deployments epic. The operator turns app_deployment
rows for its cluster into namespaced k8s objects.

- Pure, unit-tested object builders (13 tests): Namespace (restricted Pod
  Security), default-deny NetworkPolicy, PVC, ConfigMap/Secret for files,
  Deployment (locked-down securityContext: non-root, drop ALL caps, no
  privesc, read-only rootfs; PVC + file subPath read-only mounts), ClusterIP
  Service (named per compose service for intra-namespace DNS), and a
  cert-manager-TLS Ingress for the expose: ingress port.
- reconcile_app_deployments(ctx): server-side apply per deployment, filtered
  by the operator's new app_cluster_id config. Resolves env+files via
  lnvps_compose against generated secrets (stored once in a namespace
  'generated' Secret for stability) + customer config; writes back
  status/hostname; GCs namespaces for removed/deleted deployments.
- Wired into the operator's initial + periodic reconcile loop.
- ResourceQuota builder present but not yet applied (a limits.* quota needs
  container limits, which land with the capacity increment).

Part of work/app-deployments.md.
… to 0

An expired (unpaid) app deployment now scales its workload to 0 replicas
instead of being torn down: pods stop but the PVCs (customer data) are
retained. Only a real deletion GCs the namespace and its volumes. PVCs use
the cluster's default StorageClass.

- reconcile_one resolves the deployment's subscription and treats an expired
  'expires' as not-running (replicas 0), alongside desired_state/deleted.
- Adds chrono to the operator for the expiry comparison.
@v0l
v0l merged commit 4098be7 into master Jul 24, 2026
8 checks passed
@v0l
v0l deleted the feat/app-deployments-operator-reconcile branch July 24, 2026 16:31
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