Tenant delete: clean up tenant-deployed app containers #55

Closed
opened 2026-04-10 21:47:43 +02:00 by claude · 0 comments
Owner

Follow-up from #45

When a vendor deletes a tenant, DockerTenantProvisioner.remove() only removes the server + UI containers and the tenant network. App containers deployed by the tenant's server (via DeploymentExecutor) are orphaned.

Current state:

  • App containers are named {envSlug}-{appSlug}-{replicaIndex}
  • Labeled with managed-by=cameleer3-server (no tenant identifier)
  • Connected to cameleer-tenant-{slug} network

Changes needed:

  1. cameleer3-server: Add a cameleer-tenant label with the tenant slug to all deployed app containers (DeploymentExecutor). The tenant slug is derivable from CAMELEER_DOCKER_NETWORK env var (cameleer-tenant-{slug}) or should be passed as a dedicated env var (e.g. CAMELEER_TENANT_SLUG).

  2. cameleer-saas: In DockerTenantProvisioner.remove(), before removing server/UI containers and network:

    • List all containers with label cameleer-tenant={slug}
    • Stop and remove each one
    • Also remove per-environment networks (cameleer-env-{tenantId}-*)
    • Also remove the tenant's JAR volume (cameleer-jars-{slug})

Acceptance Criteria:

  • All tenant-deployed app containers are stopped and removed on tenant delete
  • Per-environment networks are cleaned up
  • JAR volume is removed
  • No orphaned Docker resources after tenant offboarding
**Follow-up from #45** When a vendor deletes a tenant, `DockerTenantProvisioner.remove()` only removes the server + UI containers and the tenant network. App containers deployed by the tenant's server (via `DeploymentExecutor`) are orphaned. **Current state:** - App containers are named `{envSlug}-{appSlug}-{replicaIndex}` - Labeled with `managed-by=cameleer3-server` (no tenant identifier) - Connected to `cameleer-tenant-{slug}` network **Changes needed:** 1. **cameleer3-server**: Add a `cameleer-tenant` label with the tenant slug to all deployed app containers (`DeploymentExecutor`). The tenant slug is derivable from `CAMELEER_DOCKER_NETWORK` env var (`cameleer-tenant-{slug}`) or should be passed as a dedicated env var (e.g. `CAMELEER_TENANT_SLUG`). 2. **cameleer-saas**: In `DockerTenantProvisioner.remove()`, before removing server/UI containers and network: - List all containers with label `cameleer-tenant={slug}` - Stop and remove each one - Also remove per-environment networks (`cameleer-env-{tenantId}-*`) - Also remove the tenant's JAR volume (`cameleer-jars-{slug}`) **Acceptance Criteria:** - All tenant-deployed app containers are stopped and removed on tenant delete - Per-environment networks are cleaned up - JAR volume is removed - No orphaned Docker resources after tenant offboarding
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cameleer/cameleer-saas#55