mirror of
https://github.com/coredns/coredns.git
synced 2025-12-07 19:05:19 -05:00
plugin/health: add lameduck mode (#1379)
* plugin/health: add lameduck mode Add a way to configure lameduck more, i.e. set health to false, stop polling plugins. Then wait for a duration before shutting down. As the health middleware is configured early on in the plugin list, it will hold up all other shutdown, meaning we still answer queries. * Add New * More tests * golint * remove confusing text
This commit is contained in:
@@ -21,6 +21,17 @@ a 503. *health* periodically (1s) polls plugin that exports health information.
|
||||
plugin signals that it is unhealthy, the server will go unhealthy too. Each plugin that
|
||||
supports health checks has a section "Health" in their README.
|
||||
|
||||
More options can be set with this extended syntax:
|
||||
|
||||
~~~
|
||||
health [ADDRESS] {
|
||||
lameduck DURATION
|
||||
}
|
||||
~~~
|
||||
|
||||
* Where `lameduck` will make the process unhealthy then *wait* for **DURATION** before the process
|
||||
shuts down.
|
||||
|
||||
## Plugins
|
||||
|
||||
Any plugin that implements the Healther interface will be used to report health.
|
||||
@@ -42,3 +53,13 @@ Run another health endpoint on http://localhost:8091.
|
||||
health localhost:8091
|
||||
}
|
||||
~~~
|
||||
|
||||
Set a lameduck duration of 1 second:
|
||||
|
||||
~~~ corefile
|
||||
. {
|
||||
health localhost:8091 {
|
||||
lameduck 1s
|
||||
}
|
||||
}
|
||||
~~~
|
||||
|
||||
Reference in New Issue
Block a user