Add a ready plugin that allows plugin to signal when they are ready.
Once a plugin is ready it is not queried again.
This uses same mechanism as the health plugin: each plugin needs to
implement an interface.
Implement readines for the *erratic* plugin to aid in testing.
Add README.md and tests moduled after the health plugin; which will be
relegated to just providing process health. In similar vein to health
this is a process wide setting.
With this Corefile:
~~~
. {
erratic
whoami
ready
}
bla {
erratic
whoami
}
~~~
ready will lead to:
~~~ sh
% curl localhost:8181/ready
% dig @localhost -p 1053 mx example.org
% curl localhost:8181/ready
OK%
~~~
Meanwhile CoreDNS logs:
~~~
.:1053
bla.:1053
2019-02-26T20:59:07.137Z [INFO] CoreDNS-1.3.1
2019-02-26T20:59:07.137Z [INFO] linux/amd64, go1.11.4,
CoreDNS-1.3.1
linux/amd64, go1.11.4,
2019-02-26T20:59:11.415Z [INFO] plugin/ready: Still waiting on: "erratic"
2019-02-26T20:59:13.510Z [INFO] plugin/ready: Still waiting on: "erratic"
~~~
*ready* can be used in multiple server blocks and will do the right
thing; query all those plugins from all server blocks for readiness.
This does a similar thing to the prometheus plugin.
Signed-off-by: Miek Gieben <miek@miek.nl>
* Move *proxy* to external
move the proxy plugin into coredns/proxy and remove it as a default
plugin. Link the proxy to deprecated in plugin.cfg
coredns/proxy doesn't compile because of the vendoring :(
Signed-off-by: Miek Gieben <miek@miek.nl>
* Add github.com/coredns/proxy
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Add new plugin: external
This plugin works in conjunction with the kubernetes plugin and exports
ingress and LB addresses as DNS records. It bypasses backend.go and
backend_lookup.go flow because it is not needed.
README, tests are implemented. The tests only exercise the unit tests,
this has not been tested in any ci.
Signed-off-by: Miek Gieben <miek@miek.nl>
* Rename to k8s_external
Signed-off-by: Miek Gieben <miek@miek.nl>
* go gen
Signed-off-by: Miek Gieben <miek@miek.nl>
* New plugin: loop
Add a plugin that detects loops. It does this by sending an unique query
to our selves. If we see the query more than twice we stop the process.
If there isn't a loop, the plugin disables it self and becomes a noop
plugin.
Signed-off-by: Miek Gieben <miek@miek.nl>
This revert 17d807f0 and re-adds the metadata plugin as a plugin that
just sets a label to a value function.
Add package documentation on how to use the metadata package. Make it
clear that any caching is up to the Func implemented.
There are now - no in tree users. We could add the request metadata by
default under names that copy request.Request, i.e
request/ip - remote IP
request/port - remote port
Variables.go has been deleted.
Signed-off-by: Miek Gieben <miek@miek.nl>
* Implement deprecation notice for 1.1.4
This still allows all the config to be parsed, but noops it:
* -log; always set the log to stdout; no matter what.
* https_google; removed from the proxy implementation.
* reverse plugin: set to deprecated.
* Whole of reverse can go
* Remove test for deprecated plugin
error on startup when we see these in a corefile:
~~~
% ./coredns
2018/03/01 06:51:23 plugin/startup: this plugin has been deprecated
% ./coredns
2018/03/01 06:51:32 plugin/shutdown: this plugin has been deprecated
~~~
Reloading should work (kill -TERM reload the coredns process), but a lot
of plugins can't handle it proper. Disable to reload plugin until we fix
(most) of the plugins
This fix is an enhancement of external plugin enabling.
Previously, it was already able to build a customerized
coredns with plugins enabled selectively, without changing
coredns source code. However, all default plugins are
actually bundled because of the import rule:
```
"github.com/coredns/coredns/coremain"
```
The issue is best described with the following:
```
root@localhost:/go/src/github.com/coredns/coredns/sample# cat sample.go
package main
import (
_ "github.com/coredns/forward"
"github.com/coredns/coredns/coremain"
"github.com/coredns/coredns/core/dnsserver"
)
var directives = []string{
"forward",
"startup",
"shutdown",
}
func init() {
dnsserver.Directives = directives
}
func main() {
coremain.Run()
}
root@localhost:/go/src/github.com/coredns/coredns/sample#
root@localhost:/go/src/github.com/coredns/coredns/sample# go build -v sample.go
root@localhost:/go/src/github.com/coredns/coredns/sample# ./sample -plugins
root@localhost:/go/src/github.com/coredns/coredns/sample# ./sample -plugins
Server types:
dns
Caddyfile loaders:
flag
default
Other plugins:
dns.auto
dns.autopath
dns.bind
dns.cache
dns.chaos
dns.debug
dns.dnssec
dns.dnstap
dns.erratic
dns.errors
dns.etcd
dns.federation
dns.file
dns.forward
dns.health
dns.hosts
dns.kubernetes
dns.loadbalance
dns.log
dns.nsid
dns.pprof
dns.prometheus
dns.proxy
dns.reverse
dns.rewrite
dns.root
dns.route53
dns.secondary
dns.template
....
```
This fix moves zplugins.go to a different package/directory so that
it is possible to "only import plugins as needed".
The following is the new output after this fix:
```
root@localhost:/go/src/github.com/coredns/coredns/sample# ./sample -plugins
Server types:
dns
Caddyfile loaders:
flag
default
Other plugins:
dns.forward
dns.prometheus
shutdown
startup
root@localhost:/go/src/github.com/coredns/coredns/sample#
```
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>