Environment lifecycle: TTL, sleep and wake
| Policy field | Meaning | Default |
|---|---|---|
defaultTTL |
TTL for environments that set none | none (never expires) |
maxTTL |
cap for spec.ttl; exceeding it is reported, not rejected |
none |
expiredGracePeriod |
how long an expired environment is kept, scaled to zero, before deletion | 24h |
sleepAfterIdle |
idle time before copies scale to zero | none (never sleeps) |
An Environment may set spec.ttl and spec.sleepAfterIdle itself.
Phases
- Ready: copies running and available.
- Sleeping: no traffic for
sleepAfterIdle; copies at zero replicas. The next request through the router wakes it and is held until the copies are ready (up to 90 s). The browser sees a "waking up" page that refreshes itself if it takes longer. - Expired:
status.expiresAtpassed; copies at zero. Preview URL answers 410. Raisespec.ttlwithin the grace period to bring it back; atstatus.deleteAtit is deleted.
Status fields: expiresAt, deleteAt, lastActivity, sleptAt, wakeRequestedAt.
Condition TTL tells whether the requested TTL was honoured or capped.
Events
Each transition is a Kubernetes Event on the Environment, visible with
kubectl get events --field-selector involvedObject.kind=Environment and ingested by the
audit log: Expired, ExpiryExtended, TTLCapped, ExpiredDeleted, Sleeping,
Woken, WakeTimeout.