Plugin/Proxy - add new policy always_first to mimic windows dns resolvers (#1459)

* add new policy always_first to mimic windows dns resolvers
fill documentation, add UT and cleanup fmt

* change name of policy from always_first to first. Update docs
This commit is contained in:
Francois Tur
2018-01-30 16:29:49 -05:00
committed by John Belamaric
parent 0af9b9b16f
commit b93a36b213
4 changed files with 44 additions and 6 deletions

View File

@@ -38,7 +38,7 @@ However, advanced features including load balancing can be utilized with an expa
.nf
proxy FROM TO\.\.\. {
policy random|least_conn|round_robin
policy random|least_conn|round_robin|first
fail_timeout DURATION
max_fails INTEGER
health_check PATH:PORT [DURATION]
@@ -58,7 +58,7 @@ proxy FROM TO\.\.\. {
\fBTO\fR is the destination endpoint to proxy to\. At least one is required, but multiple may be specified\. \fBTO\fR may be an IP:Port pair, or may reference a file in resolv\.conf format
.
.IP "\(bu" 4
\fBpolicy\fR is the load balancing policy to use; applies only with multiple backends\. May be one of random, least_conn, or round_robin\. Default is random\.
\fBpolicy\fR is the load balancing policy to use; applies only with multiple backends\. May be one of random, least_conn, round_robin or first\. Default is random\.
.
.IP "\(bu" 4
\fBfail_timeout\fR specifies how long to consider a backend as down after it has failed\. While it is down, requests will not be routed to that backend\. A backend is "down" if CoreDNS fails to communicate with it\. The default value is 2 seconds ("2s")\.