Container behavior and limits
How a Container is placed on machines, scaled, exposed, and backed up on each platform, and the limits Alien enforces.
Placement
On AWS, Google Cloud, and Azure, replicas run on the machines of a ComputeCluster. If the stack declares none, Alien creates one with a general pool.
When .pool() isn't set, Alien picks the pool in this order:
stateful, when the container has persistent storage.gpu, when it requests a GPU.storage, when ephemeral storage is over 200 Gi.generalotherwise.
A stateful replica is placed where its volume lives.
Scaling
| Call | Min | Desired | Max |
|---|---|---|---|
.replicas(n) | n | n | n, autoscaling off |
.minReplicas(n) | n | n | 10 × n |
.maxReplicas(n) alone | 1 | 1 | n |
.autoScale(cfg) | cfg.min | cfg.desired | cfg.max |
Autoscaling targets 70% CPU and 80% memory unless you set them. It can also scale on in-flight HTTP requests per replica (targetHttpInFlightPerReplica) and on p95 latency (maxHttpP95LatencyMs).
Public endpoints
- All public endpoints on one container route to the same backend port.
- HTTP and TCP endpoints can't be mixed on one container.
- Only one endpoint can use the apex (
hostLabel: "@"), and it can't also take wildcard subdomains. - Endpoint names are lowercase DNS labels, up to 63 characters.
- TCP endpoints work on AWS, Google Cloud, Azure, and Local. Kubernetes and Machines refuse them.
| Platform | HTTP | TCP |
|---|---|---|
| AWS | Application Load Balancer | Network Load Balancer |
| Google Cloud | Network endpoint groups and a backend service behind an HTTPS proxy | Same, behind a TCP proxy |
| Azure | Application Gateway | Azure Load Balancer |
Volumes
Each ordinal keeps its volume across restarts and replacement. Snapshots are crash-consistent and stay in the customer's account, in the volume's region. They keep being taken when the deployment can't reach Alien.
| Platform | Volume | Snapshots |
|---|---|---|
| AWS | gp3 EBS | Amazon Data Lifecycle Manager |
| Google Cloud | Persistent Disk | Compute Engine snapshot schedule |
| Azure | Managed Disks | Azure Disk Backup |
| Kubernetes | PersistentVolumeClaim templates | None. Use the cluster's tooling, such as VolumeSnapshots or Velero. |
| Machines | Not supported | |
| Local | Bind mounts | None |
Backup schedule
intervalHours is 1, 2, 4, 6, 8, 12, or 24 (default 24). retentionDays is 1 to 365 (default 7). A volume holds at most 450 snapshots, so hourly backups can be kept for up to 18 days.
Turning backups off keeps existing snapshots until the container is deleted. When the container is deleted, Alien keeps one final snapshot of each volume, unless backups are off.
The volumeBackups.state output is active, disabled, or setupRequired. setupRequired means the deployment's management permissions predate volume backups. The container keeps running without a schedule, and the schedule is applied once the customer's admin reruns initial setup.
Restore
alien deployments restore-volume restores one replica's volume:
- Alien snapshots the current volume, so the restore can be undone.
- It stops that replica.
- It creates a new volume from the snapshot, in the same zone.
- It starts the replica on the new volume.
Other replicas keep running. The snapshot must belong to the same deployment and be no larger than the configured size. If a restore fails, retry the deployment or run alien deployments cancel-volume-restore.
Platform checks
Alien refuses these at plan time:
| Declaration | Refused on |
|---|---|
.egress("internet") | Kubernetes, Machines, Local. Also refused without security.profile: "restricted". |
.security() | Local |
.kubernetesSecretMount(), .kubernetesLivenessProbe(), .kubernetesReadinessProbe() | Every platform except Kubernetes |
| Stateful containers | Machines |
| TCP public endpoints | Kubernetes |
| Any public endpoint | Machines (MACHINES_CONTAINER_PUBLIC_ENDPOINT). Serve it from a Daemon with host networking instead. |
On AWS, a Worker can link at most 4 Containers that have ports.
Linking a Container that has ports opens them to the linker. On AWS, Google Cloud, and Azure, the plan refuses these links with CONTAINER_NETWORK_SETTINGS_UNSUPPORTED:
- A Container or Daemon in a different compute cluster from the target.
- On Google Cloud and Azure, any linker other than a Container or Daemon, such as a Worker.
- On AWS, a Sandbox without
.egress("internet"). - On AWS, a target that a Worker or Sandbox links and that needs more than 32 load balancer targets: one per distinct port, plus one when it has public endpoints.
Limits
| Limit | Value |
|---|---|
| Public backend ports | 1 per container |
| Apex endpoints | 1 per container |
| Endpoint name | Lowercase DNS label, up to 63 characters |
| GPU count | 1 to 8 |
| Health check timeout | 1 to 5 seconds |
| Stop grace period | 1 to 86,400 seconds |
| Backup interval | 1, 2, 4, 6, 8, 12, or 24 hours |
| Backup retention | 1 to 365 days |
| Snapshots per volume | 450 |
| Load balancer targets on AWS | At most 32 per container |
Changes that replace the resource
Changing any of these after create replaces the container: id, cluster, stateful mode, ports, public endpoints, pool, and persistentStorage.encryptionKey.