Environment lifecycle: TTL with 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 rather than 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 and deleteAt and lastActivity and sleptAt and
wakeRequestedAt. Condition TTL tells whether the requested TTL was honoured or capped.
Events
Each transition is a Kubernetes Event on the Environment. It is visible with
kubectl get events --field-selector involvedObject.kind=Environment and ingested by the
audit log. The events are:
ExpiredExpiryExtendedTTLCappedExpiredDeletedSleepingWokenWakeTimeout