Changing the configuration without a restart
GuideOperationsSince version 0.1.0
Operations guide: configure, deploy and observe the gateway. What the capability does, product side: product guide; calling it: developer guide.
Goal: add a route, tune a quota, serve a second API - without a restart and without losing a request.
Command - edit the file; the gateway reads flexway.yaml and its contracts again every 5 s
(server.reload.interval):
$EDITOR openapi.yaml
docker kill -s HUP flexway # optional: take the change at onceA second API, on its own host, from its own contract:
hosts:
admin.example.com:
default_upstream: backoffice
contracts: [./admin.yaml] # this host serves exactly this contract, nothing of openapi.yamlCheck: /config (admin port) shows a new config_version, a new config_digest (the semantic
digest flexway validate prints) and last_reload.result: applied.
A deliberate mistake - an upstream that does not exist - replaces nothing: the running
configuration keeps serving, last_reload.result: rejected, the cause in last_reload.cause and in
the log, once.
Eight settings need a restart:
server.shutdown,server.reload,server.counters,server.shedding,server.in_flight,server.cache,server.tlsandobservability. Changing one refuses the whole reload, naming the key. Requests in flight finish on the previous configuration, streams included.