middleware/etcd: Use the correct endpoint
The endpoint for etcd as wrongly set if a proxy was configured. Clean up some documentation in the process as well.
This commit is contained in:
parent
913cffd4a8
commit
a1e6cb7cf4
9 changed files with 8 additions and 24 deletions
|
@ -17,7 +17,7 @@ import (
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultEndpoint = "http://127.0.0.1:2379"
|
const defaultEndpoint = "http://localhost:2379"
|
||||||
|
|
||||||
// Etcd sets up the etcd middleware.
|
// Etcd sets up the etcd middleware.
|
||||||
func Etcd(c *Controller) (middleware.Middleware, error) {
|
func Etcd(c *Controller) (middleware.Middleware, error) {
|
||||||
|
@ -125,7 +125,6 @@ func etcdParse(c *Controller) (etcd.Etcd, bool, error) {
|
||||||
args[i] = h + ":53"
|
args[i] = h + ":53"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
endpoints = args
|
|
||||||
etc.Proxy = proxy.New(args)
|
etc.Proxy = proxy.New(args)
|
||||||
case "tls": // cert key cacertfile
|
case "tls": // cert key cacertfile
|
||||||
args := c.RemainingArgs()
|
args := c.RemainingArgs()
|
||||||
|
|
|
@ -15,7 +15,7 @@ etcd [zones...]
|
||||||
|
|
||||||
* `zones` zones etcd should be authoritative for.
|
* `zones` zones etcd should be authoritative for.
|
||||||
|
|
||||||
The path will default to `/skydns` the local etcd proxy (http://127.0.0.1:2379).
|
The path will default to `/skydns` the local etcd proxy (http://localhost:2379).
|
||||||
If no zones are specified the block's zone will be used as the zone.
|
If no zones are specified the block's zone will be used as the zone.
|
||||||
|
|
||||||
If you want to `round robin` A and AAAA responses look at the `loadbalance` middleware.
|
If you want to `round robin` A and AAAA responses look at the `loadbalance` middleware.
|
||||||
|
@ -45,12 +45,14 @@ This is the default SkyDNS setup, with everying specified in full:
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
.:53 {
|
.:53 {
|
||||||
etcd {
|
etcd skydns.local {
|
||||||
stubzones
|
stubzones
|
||||||
path /skydns
|
path /skydns
|
||||||
endpoint http://localhost:2397
|
endpoint http://localhost:2379
|
||||||
upstream 8.8.8.8:53 8.8.4.4:53
|
upstream 8.8.8.8:53 8.8.4.4:53
|
||||||
}
|
}
|
||||||
|
prometheus
|
||||||
|
cache 160 skydns.local
|
||||||
loadbalance
|
loadbalance
|
||||||
proxy . 8.8.8.8:53 8.8.4.4:53
|
proxy . 8.8.8.8:53 8.8.4.4:53
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
package etcd
|
package etcd
|
||||||
|
|
||||||
// etcd needs to be running on http://127.0.0.1:2379
|
// etcd needs to be running on http://localhost:2379
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
|
@ -2,10 +2,6 @@
|
||||||
|
|
||||||
package etcd
|
package etcd
|
||||||
|
|
||||||
// etcd needs to be running on http://127.0.0.1:2379
|
|
||||||
// *and* needs connectivity to the internet for remotely resolving
|
|
||||||
// names.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
|
@ -73,6 +73,7 @@ func (e Etcd) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i
|
||||||
return e.Err(zone, dns.RcodeNameError, state)
|
return e.Err(zone, dns.RcodeNameError, state)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
println("returning error", err.Error())
|
||||||
return dns.RcodeServerFailure, err
|
return dns.RcodeServerFailure, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,6 @@
|
||||||
|
|
||||||
package etcd
|
package etcd
|
||||||
|
|
||||||
// etcd needs to be running on http://127.0.0.1:2379
|
|
||||||
// *and* needs connectivity to the internet for remotely resolving
|
|
||||||
// names.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/miekg/coredns/middleware/etcd/msg"
|
"github.com/miekg/coredns/middleware/etcd/msg"
|
||||||
"github.com/miekg/coredns/middleware/test"
|
"github.com/miekg/coredns/middleware/test"
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
|
|
||||||
package etcd
|
package etcd
|
||||||
|
|
||||||
// etcd needs to be running on http://127.0.0.1:2379
|
|
||||||
// *and* needs connectivity to the internet for remotely resolving names.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
|
@ -4,10 +4,6 @@
|
||||||
|
|
||||||
package etcd
|
package etcd
|
||||||
|
|
||||||
// etcd needs to be running on http://127.0.0.1:2379
|
|
||||||
// *and* needs connectivity to the internet for remotely resolving
|
|
||||||
// names.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
|
|
||||||
package etcd
|
package etcd
|
||||||
|
|
||||||
// etcd needs to be running on http://127.0.0.1:2379
|
|
||||||
// *and* needs connectivity to the internet for remotely resolving names.
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
Loading…
Add table
Reference in a new issue