Scale to zero: an idle service sleeps, and its next request wakes it.
Upgrade notes
- One additive migration (0089: nullable
services.sleep_after_minutesandservices.asleep_at), nothing to turn on, nothing that worked is refused. No service sleeps after the upgrade. A Docker install whose panel is published on loopback (the default before 0.16) is reached through theninedeploynetwork instead. The panel container joins it asninedeploy-panel, but only when a service is first about to sleep, never at upgrade.
Added
- Scale to zero for docker services on the panel host.
- Setting:
sleepAfterMinutes(5–1440) onPATCH /v1/services/:id. - Going to sleep: once the service's domains have had no request for that long, they are routed to the panel's wake endpoint (
/_nd/wake, after the domain's basic auth and allow list) and its containers stop. - Waking: the next request starts the containers, waits for the healthcheck and routes the domains back.
- A GET or HEAD gets
307to the same URL. - Other methods get
503withRetry-After. - A wake slower than 25 s answers a self-reloading "Waking up" page.
- A GET or HEAD gets
- Requirements: traffic analytics on (requests are counted from the traffic log) and a routed domain.
- Audit: events
service.sleep,service.wake(with the trigger) andservice.sleep_now.
- Setting:
- By hand.
POST /v1/services/:id/sleepandPOST /v1/services/:id/wake. Start and restart wake a sleeping service; stop and a deploy end the sleep. The web app shows an Asleep badge with Wake now and Sleep now, and a Sleep when idle card in Settings. The CLI hasninedeploy sleep show|set|off|now|wake, and the SDKclient.services.sleepandclient.services.wake. See docs/DEPLOYMENTS.md. - A service that could not wake never sleeps. Before anything sleeps, the panel checks that a request from inside the Traefik container reaches it. When it does not, the sleep is refused with the reason.
Changed
- The runtime reconcile and the autoscaler leave a sleeping service alone.