Commit graph

284 commits

Author SHA1 Message Date
Miek Gieben
24176a97e6
Move to CODEOWNERS ()
* Move to CODEOWNERS

No change in who own what; just a move to CODEOWNERS. This allows
dreck cleanups.

Added .dreck.yaml for alias and exec.

Fixes: 

Signed-off-by: Miek Gieben <miek@miek.nl>

* stickler bot

Signed-off-by: Miek Gieben <miek@miek.nl>

* sort the file

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-11-29 13:17:05 +00:00
Miek Gieben
65458b2de2
Directive -> plugin ()
Caught my eye, we name things directive still, esp when talking about
the prometheus *plugin*. Rename everything that needs to be plugin to
'plugin'. Also make sure Metrics is a H2 section (not H1).

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-10-08 10:20:48 +01:00
Miek Gieben
ffe6225ff6 kubernetes: brush up README, rename metric ()
Other latency metrics have `_duration` in the name change this metric
to be in sync with the other ones.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-10-07 08:38:46 -07:00
janluk
d7cdb992b4 Measure and expose DNS programming latency from Kubernetes plugin. ()
For now metric is measure only for headless services. Informer has been slighlty
refactored, so the code can measure latency without storing extra fields on
Endpoint struct.

Signed-off-by: Janek Łukaszewicz <janluk@google.com>

Suggestions from code review

Co-Authored-By: Chris O'Haver <cohaver@infoblox.com>
2019-10-04 16:48:43 +01:00
Guangming Wang
8af4685587 cleanup code by lint ()
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-09-27 11:10:34 +01:00
xieyanker
9a5e4fa1a0 fix mis-spelling ()
Signed-off-by: xieyanker <xjsisnice@gmail.com>
2019-09-26 13:19:45 +01:00
Guangming Wang
081e45afa3 cleanup: remove redundant return statement ()
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-09-23 14:40:14 +01:00
Miek Gieben
004c5fca9d
all: simply registering plugins ()
Abstract the caddy call and make it simpler.

See  for some part of the discussion.

Go from:

~~~ go
func init() {
       caddy.RegisterPlugin("any", caddy.Plugin{
               ServerType: "dns",
               Action:     setup,
       })
}
~~~

To:

~~~ go
func init() { plugin.Register("any", setup) }
~~~

This requires some external documents in coredns.io to be updated as
well; the old way still works, so it's backwards compatible.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-09-20 08:02:30 +01:00
Chris O'Haver
70f2bd1dff dont duplicate service recrod for every port () 2019-09-08 08:28:30 +01:00
Cricket Liu
47b8ce1fff Fixing the top-level description () 2019-09-08 08:23:54 +01:00
Chris O'Haver
630d3d60b9
plugin/kubernetes: Handle multiple local IPs and bind ()
* use all local IPs

* mult/bind ips

* gofmt + boundIPs fix

* fix no matching endpoint case

* don't duplicate NS records in answer

* fix answer dedup

* fix comment

* add multi local ip test case
2019-09-05 09:07:55 -04:00
陈谭军
df6235995b fix the-the mistake () 2019-08-28 07:18:33 +01:00
Miek Gieben
07748d0c34
go report card fixes ()
Went over the list at https://goreportcard.com/report/github.com/coredns/coredns
and removed/fix some code to make it slightly happier.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-08-24 18:14:25 +00:00
Chris O'Haver
338d148c78 plugin/k8s_external/kubernetes: handle NS records ()
* fix external ns records

* use k8s service name for ns record

* update test, add func comment

* expand nsAddrs() test cases

* support local ipv6 ip

* use less confusing pod ip in test
2019-08-23 16:54:06 +00:00
AllenZMC
434ac69a03 fix wrong spells in parse_test.go () 2019-08-22 09:59:12 -04:00
Chris O'Haver
3f47fc8ba4
typo fixes ()
* spelling fixes

* its/it's
2019-08-21 16:08:55 -04:00
Xigang Wang
81bba80159 Change the ToEndpoints method comment to replace the Service with Endpoints () 2019-08-19 09:34:09 -04:00
Yong Tang
6402cef337
Move federation plugin to github.com/coredns/federation ()
* Remove federation

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Rebuild and point to github.com/coredns/federation

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Export `localNodeName` => `LocalNodeName`, to be used by federation (until deprecation)

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Remove plugin/kubernetes/federation.go (=> kubernetes/federation repo)

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Update github.com/coredns/federation

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* sticker-ci fix

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-08-18 14:41:51 -07:00
AllenZMC
d36ca09c97 fix mis-spelling in object.go () 2019-08-16 09:29:06 -04:00
AllenZMC
fe60f10300 fix typos in kubernetes.go () 2019-08-15 09:15:23 -04:00
AllenZMC
3c45e55f91 Update parse.go () 2019-08-13 09:47:23 -07:00
Chris O'Haver
a64ff8cc0a fix NXDOMAIN/NODATA fallthough case () 2019-08-12 18:43:22 +00:00
Chris O'Haver
3a59c833a0 plugin/kubernetes: Don't do a zone transfer for NS requests ()
* fix switch order

* remove fallthough

* add test

* fix test

* distingush nxdomain/nodata for at least first subdomain of zone

* restore fallthough; reorder switch cases
2019-08-09 21:14:48 +00:00
Miek Gieben
a01b202b6a Fixes races in test and klog ()
Various fixes to make things less flaky:

* kubernetes: put klog.SetOutput in the setup function, not in the init
  function to see if that helps
* file: make z.Expired a boolean instead of a pointer to a boolean
* test: fix TestSecondaryZoneTransfer test, which wasn't actually
  testing in the right way. It's more right now, but may still be racy
  (race introduced because a file's lazy loading of zones)

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-08-01 05:51:37 -07:00
Miek Gieben
4fda9535d2
plugin/kubernetes: remove some of the klog setup ()
I don't believe this is actually needed (anymore). The:

os.Stderr = os.Stdout

is a crazy hack that def. needs to go.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-30 16:35:07 +00:00
Anshul Sharma
f9fb9db171 ISSUE-2911 ()
- Remove resyncperiod from Kubernetes plugin
2019-07-03 20:39:12 +01:00
Yong Tang
f8bba51f84
Update Caddy to 1.0.1, and update import path ()
* Update Caddy to 1.0.1, and update import path

This fix updates caddy to 1.0.1 and also
updates the import path to github.com/caddyserver/caddy

This fix fixes 2959

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Also update plugin.cfg

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Update and bump zplugin.go

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-07-03 09:04:47 +08:00
Miek Gieben
22c6e3e179
plugins: set upstream unconditionally ()
`upstream` is not needed as a setting; just set if unconditionally and
remove all documentation and tests for it.

At some point we want remove the hanlding for `upstream` as well and
error out on seeing it.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-02 16:23:47 +01:00
Miek Gieben
cd176f859b Run gofmt -s and golint on the codebase ()
* Run gofmt -s and golint on the codebase

Run golint and fix everythign it flagged (except the context arg
ordering), mostly edits in the rewrite plugin.

Signed-off-by: Miek Gieben <miek@miek.nl>

* ... and ofcourse the test as well

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-06-25 15:00:33 +08:00
Yong Tang
60f483e98b Fix lowercase presummit ()
While running make encountered the following error:
```
$ docker run -i -t --rm -v $PWD:/v --net=host -w /v golang:1.12 make
...
...
** presubmit/test-lowercase
plugin/kubernetes/metadata_test.go:			t.Errorf("case %d expected metadata %v and got %v", i, tc.Md, md)
** presubmit/test-lowercase: please start with an upper case letter when using t.Error*()
Makefile:62: recipe for target 'presubmit' failed
make: *** [presubmit] Error 1
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-06-10 07:35:07 +01:00
John Belamaric
ffcd2f61cf Publish metadata from kubernetes plugin ()
* Publish metadata from kubernetes plugin

* stickler fix

* Add a couple tests

* Add metadata section to README

* Update plugin/kubernetes/README.md

Co-Authored-By: Chris O'Haver <cohaver@infoblox.com>

* Address nit
2019-06-09 08:10:57 +01:00
Chris O'Haver
bd83f74deb remove unused functions () 2019-06-09 08:09:55 +01:00
Francois Tur
d3e2ef73b8 stepdown from CoreDNS maintainer () 2019-06-03 16:21:05 -04:00
Miek Gieben
3b3fb6f583
plugin/kubernetes: skip deleting pods ()
Don't add pods to our internal cache that are being deleted. This saves
a field in the struct as well.

Add (extra) comments about adding fields to the
object/{Pod,Service,Endpoint} structs.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-06-01 08:39:52 +01:00
Chris O'Haver
5565ca1c03 kubernetes: bump to client-go 11.0.0 ()
* client-go 11.0.0

* Core moved to CoreV1
2019-05-31 08:01:48 -07:00
Andras Spitzer
7dde3f3958 Fix for , instead of returning the first Pod, return the one whi… ()
* Fix for , instead of returning the first Pod, return the one which is Running

* a more memory efficient version of the fix, string -> bool

* fix with no extra fields in struct, return nil at Pod conversion if Pod is not Running

* let Kuberneretes filter for Running Pods using FieldSelector

* filter for Pods that are Running and Pending (implicit)
2019-05-29 08:06:45 +01:00
Chris O'Haver
c147e20373 make ignore empty work with ext svc types () 2019-05-07 17:31:50 -07:00
Billie Cleek
e178291ed6 kubernetes: never respond with NXDOMAIN for authority label ()
* kubernetes: never respond with NXDOMAIN for authority label

Return a nodata response when trying to resolve the authority's label
for a record type that doesn't match the record type of the authority.

This guards against poisoning the authority record by requesting the
wrong record type for the authority label. For instance, given an
authoritative resolver that uses subdomain delegation for Kubernetes
services of a cluster that's configured to use IPv4, the parent may be
poisoned by querying it for the authority label of the cluster subdomain
with a AAAA record type, which would otherwise (i.e. without this
change) return an NXDOMAIN. That is, given
	cluster.example.com        NS 10800 ns.dns.cluster.example.com
	ns.dns.cluster.example.com A  10800 10.0.1.2
The parent may be poisoned for the SOA TTL by querying it for a AAAA
record of ns.dns.cluster.example.com, causing the parent to fail
delegate properly until the SOA TTL lapses.

* kubernetes: add tests for authority queries
2019-05-01 10:42:38 -04:00
Miek Gieben
be1ac9fed4
plugins: remove upstream [ADDRESS] from docs ()
Various plugins still had this documented, the setup functions still
allow it (which is fine), but update the docs that this arguments isn't
there any more.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-04-08 16:45:29 +01:00
Miek Gieben
58c703f5ef
Run gofmt -w -s on codebase ()
This formats and simplifies all code by running gofmt -w -s on all Go
files.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-04-08 11:13:46 +01:00
John Belamaric
2418a6b2d2
plugin/kubernetes: Disable resync by default ()
* Disable resync by default

* Document default resync
2019-04-02 14:55:25 -07:00
John Belamaric
aea98acf2f
Bump the resync period to five hours () 2019-04-01 16:24:55 -07:00
Chris O'Haver
f6eb2a4c14 restore change detection () 2019-03-26 15:26:19 +00:00
Miek Gieben
53f3f0b666
Remove context.Context from request.Request ()
* Remove context.Context from request.Request

This removes the context from request.Request and makes all the changes
in the code to make it compile again. It's all mechanical. It did
unearth some weirdness in that the context was kept in handler structs
which may cause havoc with concurrently handling of requests.

Fixes 

Signed-off-by: Miek Gieben <miek@miek.nl>

* Make test compile

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-26 14:37:30 +00:00
Matt Greenfield
a3dd8cdf8d Add namespace_labels configuration for kubernetes plugin () 2019-03-22 14:32:40 +00:00
Miek Gieben
43c3e0ab68 plugin/kubernetes: add ready function ()
* plugin/kubernetes: add ready function

Add ready function as the health function is now gone.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix readme

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-20 09:32:23 -04:00
Yong Tang
162c3dd95d Remove proxy from kubernetes file ()
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-03-11 19:47:29 +00:00
Miek Gieben
c778b3a67c
plugin/health: remove ability to poll other plugins ()
* plugin/health: remove ability to poll other plugins

This mechanism defeats the purpose any plugin (mostly) caching can still
be alive, we can probably forward queries still. Don't poll plugins,
just tell the world we're up and running.

It was only actually used in kubernetes; and there specifically would
mean any network hiccup would NACK the entire server health.

Fixes: 

Signed-off-by: Miek Gieben <miek@miek.nl>

* update docs based on feedback

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-07 22:13:47 +00:00
Yong Tang
9dd288943a Move *proxy* to external ()
* 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>
2019-03-04 07:32:38 +00:00
LongKB
780a433de8 Update deprecated link in doc ()
Currently, the modified link is out of date. This patch aims to update
this link to the working one that user can access.

Co-Authored-By: Nguyen Phuong An <AnNP@vn.fujitsu.com>
Signed-off-by: Kim Bao Long <longkb@vn.fujitsu.com>
2019-02-24 18:17:52 -08:00