Commit graph

2870 commits

Author SHA1 Message Date
Miek Gieben
beef212fbe
plugin/log: remove OutputFile (#1217)
* plugin/log: remove OutputFile

We use stdout for everything, remove OutputFile as it isn't used and
causes confusion.

Fixes #1216

* PR feedback
2017-11-10 15:17:12 +00:00
Miek Gieben
0186aadfcf
fuzz: put fuzzing stuff in own build tag (#1215)
No need to have this build all the time.
2017-11-10 13:59:42 +00:00
Miek Gieben
4443b4a096
server: update comment (#1213)
Because we have our own mux we can't depend on the dns.Mux to do the
Question section checking for us. Clarify this in the comment.
2017-11-10 11:19:49 +00:00
John Belamaric
93e481a247
Revert source graph branch (#1210)
I think this badge is misleading as we are not a library so the number of projects we are used in is not really relevant to our adoption. It is more-or-less just the number of external plugins people have built.
2017-11-08 15:21:44 -05:00
Chris O'Haver
1a96fd2aee plugin/k8s: fix pods disabled behavior (#1207)
* fix pods disabled behavior

* do away with pod mode specific error
2017-11-08 18:58:48 +00:00
Yong Tang
5d3bfef732 Add source graph used by badge (#1209)
We are used by 10+ other projects now. Think it makes
sense to add this badge.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-11-08 18:34:45 +00:00
Chris O'Haver
0b93ea5147 k8s readme tweaks (#1206)
fix minor capitalization and grammar errors
2017-11-08 12:08:32 -05:00
Yong Tang
f6caa48b94 Update zipkin to the newer version (#1205)
* Update zipkin to the newer version

Also update thrift to use head commit

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

* Update vendor directory.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-11-08 16:21:11 +00:00
Brian Akins
3527be6c00 Add option to use pod name rather than IP address for Kubernetes (#1190)
Change to use a new 'endpoints' directive and use a constant

Add initial docs for 'endpoints' directive

Add tests to Kubernetes setup for endpoints

Changes based on PR feedback

endpoint_pod_names is a boolean config option. Chahanged docs to reflect this.

Add a test when endpoints_pod_names is not set

Update README.md

Remove endpointNameModeName as it is no longer used
2017-11-08 08:07:10 -05:00
Yong Tang
c6ce769fc6 Fix version for apimachinery and ugorji/go in Gopkg.toml (#1203)
This fix is an attempt to fix the issue raised #1192.
The issue that a plain `dep -ensure update` fails is because
the incompatibility of ugorji/go with the rest of packages (etcd, k8s etc)
and the incompatibility of client-go vs. apimachinery.

This fix fixed apimachinery and ugorji/go so that it is possible
to use `dep -ensure update`.

Previously updates has to be done individually, e.g.,
`dep -ensure update github.com/coreos/etcd`

This fix fixes #1192.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-11-05 07:24:40 +00:00
Yong Tang
246d896edd Always use LE for ppc64le. (#1201)
* Use one `PLATFORM` variable to setup the build process

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

* Update Makefile.release

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-11-04 07:41:35 +00:00
Miek Gieben
6bea4cd14e release: fixes to push to docker
Last minute fixes to push to hub.docker.com.
2017-11-03 20:52:53 +00:00
Miek Gieben
d272e525b5 Release 0.9.10 2017-11-03 20:32:35 +00:00
Yong Tang
37e1acf9be Update docker-build steps in Makefile.release (#1200)
* Update docker-build steps in Makefile.release

for different architectures

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

* Update to use `case ... esac` in shell script

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

* Remove `RUN` cmd in Dockerfile in case of non amd64 CPU

ssl will only be supported on amd64 CPUs for now.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-11-03 20:29:50 +00:00
Miek Gieben
64c3eb1518 Makefile: add Windows target (#1199)
While we at it, why not add a target for Windows as well.

This also introduces a VERBOSE option that defaults to -v, but it empty
when releases so that you can actually see what you're building.

Move an @echo out of shell snippet into the Makefile, as that errored
with @echo: command not found.

Sample run and resulting artifacts:

~~~
% make -f Makefile.release build
% find build -type f -exec file {} \;
build/windows/amd64/coredns: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows
build/darwin/amd64/coredns: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS>
build/linux/ppc64le/coredns: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, stripped
build/linux/amd64/coredns: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
build/linux/arm/coredns: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped
build/linux/s390x/coredns: ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), statically linked, stripped
build/linux/arm64/coredns: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped

% make -f Makefile.release tar
% find release -type f | sort
release/coredns_0.9.9_darwin_amd64.tgz
release/coredns_0.9.9_linux_amd64.tgz
release/coredns_0.9.9_linux_arm64.tgz
release/coredns_0.9.9_linux_arm.tgz
release/coredns_0.9.9_linux_ppc64le.tgz
release/coredns_0.9.9_linux_s390x.tgz
release/coredns_0.9.9_windows_amd64.tgz
~~~
2017-11-03 09:45:13 -04:00
Yong Tang
1fc0c16968 Update vendor libraries except client-go, apimachinery and ugorji/go (#1197)
This fix updates vendor libraries except client-go, apimachinery
and ugorji/go, as github.com/ugorji/go/codec is causing compatibilities issues.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-11-03 07:20:15 +00:00
Miek Gieben
af6086d653
release: use for-loop to minimize duplication (#1196)
* release: use for-loop to minize duplication

Use LINUX_ARCH as the basis for all release.

Fix a few typos along the way.

* remove echo
2017-11-02 21:21:57 +00:00
Sandeep Rajan
7d545aeff7 Add docker image to be a manifest list (#1195)
* add manifest list

* nit

* change check
2017-11-02 20:15:17 +00:00
Yong Tang
091e04f8ed Use amd64 instread of x86_64 when building architecture (#1194)
In Makefile.release `shell uname -m` was used to find the current architecture.
On amd64 systems this might be reported as `x86_64` depending on the Linux.
However, in order to have manifest docker images we need to stick with
golang's architecture tag of `amd64`.

This fix changes instead so that the correct architecture conforming to
golang (`amd64`) could be build.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-11-02 17:59:30 +00:00
Miek Gieben
2c80551fdc
plugin/{kubernetes/etcd}: dynamic SOA (#1188)
Add a dynamic SOA record (at least the serial and minttl). This create
another interface that should be implemented by the backends.

For now default to returning epoch in as a uint32 (no change from
before).

Lower the minTTL returned to 30s (from 60s)
2017-11-01 10:11:34 +00:00
Miek Gieben
fa2ae3fb43 docs: updates some, remove others (#1187)
Fix typo in kubernetes/README.md and remove DEV-README.md as it is stale
and information on the website is more up to date.

Remove large sections of text in plugin.md; just talk about how to
structure your plugin and docs.
2017-10-31 09:33:41 -04:00
Pat Moroney
1d4ac4adbb add goroutine to check hosts file for updates (#1180)
* add goroutine to check hosts file for updates

* rename parseFile to parseReader, remove extra error check
2017-10-31 07:40:47 +00:00
Miek Gieben
87c9f00c83
readme: more tests (#1184)
* readme: more tests

Add dnssec and file plugin to the test readme. This requires creating a
bunch of files with the right content. Doing so already unconvered an
unconditional type assertion in DNSSEC. This PR will include the fix for
that as well.

Also extended the snippets in the file plugin README, so that they are
whole Corefile - showing more value and checking all corefile snippets.

Create outliner right now is the kubernetes plugin, because even setting
the right env vars will result in:

open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory":

Which we can't create for a test.

* lint
2017-10-31 07:14:49 +00:00
Miek Gieben
4a4556f0d6 release: speed up build (#1181)
Don't use the 'check and godep' target when building for a release, this
is now repeated 6 times for no reason as this is already checked on
travis.

Some other cleanups in the documentation as well.
2017-10-30 08:55:41 -07:00
Miek Gieben
22f9fc5aa5 release: add more build targets (#1179)
* release: add more build targets

This adds amd64, ppc and s390. Rework some other builds/directories.

This builds:
% find build
build
build/darwin
build/darwin/x86_64
build/darwin/x86_64/coredns
build/linux
build/linux/ppc64
build/linux/ppc64/coredns
build/linux/x86_64
build/linux/x86_64/coredns
build/linux/arm64
build/linux/arm64/coredns
build/linux/s390
build/linux/s390/coredns
build/linux/arm
build/linux/arm/coredns

% make -f Makefile.release tar
rm -rf release && mkdir release
tar -zcf release/coredns_0.9.9_linux_x86_64.tgz -C build/linux/x86_64 coredns
tar -zcf release/coredns_0.9.9_darwin_x86_64.tgz -C build/darwin/x86_64 coredns
tar -zcf release/coredns_0.9.9_linux_armv6l.tgz -C build/linux/arm coredns
tar -zcf release/coredns_0.9.9_linux_armv8l.tgz -C build/linux/arm64 coredns
tar -zcf release/coredns_0.9.9_linux_ppc64le.tgz -C build/linux/ppc64 coredns
tar -zcf release/coredns_0.9.9_linux_s390x.tgz -C build/linux/s390 coredns

Checking:
% for i in $(find build -type f); do file $i; done
build/darwin/x86_64/coredns: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS>
build/linux/ppc64/coredns: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, stripped
build/linux/x86_64/coredns: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
build/linux/arm64/coredns: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped
build/linux/s390/coredns: ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), statically linked, stripped
build/linux/arm/coredns: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped

* code review
2017-10-27 22:54:42 -04:00
Miek Gieben
a63f2ae7a2
doc: update README (#1178)
People are using it in prod and some other updates.
2017-10-27 20:08:25 +01:00
Paul Hoffman
b5d8f2a3d1 Rearrange the compilation steps in the README (#1176)
Emphasize `go get` as the main way to get the project.
2017-10-26 07:47:19 +01:00
Paul Hoffman
d01028d6f0 Added note to README about go version requirements (#1175) 2017-10-25 21:27:51 +01:00
Chris O'Haver
e8184d3a5a plugin/kubernetes: Modify integration tests for coredns/ci (#1152)
* integration ci

* rename test

* unfunctionalize DoIntegrationTests

* alphabetize expected answers

* Enable out-of-cluster test

* Enable out-of-cluster test

* move integration tests back to ci repo
2017-10-25 15:40:48 -04:00
Miek Gieben
c2d93f7182 plugin/dnstap: some cleanup (#1172)
Some cleanup in proxy and dnstap:
* just use time pkg directly and side step the indirection for Epoch
* Use Set in SetQueryEpoch to be more Go like. (Looked like a reader)
* Don't maintain two sets of time, we already track start, so use that.
* Use time.Time and convert when needed
* dedent the toDnstap function and put in a separate file
2017-10-25 19:46:41 +01:00
Pat Moroney
25367a4329 remove the defer 2017-10-24 14:28:41 -06:00
Pat Moroney
53d9bff707 read lock around ReadHosts() 2017-10-24 13:46:58 -06:00
Pat Moroney
680e6bd5c3 move ReadHosts out of the lock 2017-10-24 10:34:16 -06:00
Pat Moroney
7ad99d0d36 Fix locking for hosts plugin 2017-10-24 10:27:07 -06:00
Miek Gieben
cc490a8912 plugin/kubernetes: lazy initialze EndPointsList (#1168)
If we don't need it, don't initialize it.

Fixes #1156
2017-10-24 12:44:34 +01:00
Miek Gieben
fcd0342e42 CIDR query routing (#1159)
* core: allow all CIDR ranges in zone specifications

Allow (e.g.) a v4 reverse on a /17. If a zone is specified in such a
way a FilterFunc is set in the config. This filter is checked against
incoming queries.

For all other queries this adds a 'x != nil' check which will not impact
performace too much. Benchmark function is added as well to check for
this as wel.

Add multiple tests in tests/server_reverse_test.go.

Benchmark shows in the non-reverse case this hardly impact the speed:

~~~
classless:
pkg: github.com/coredns/coredns/core/dnsserver
BenchmarkCoreServeDNS-4   	 1000000	      1431 ns/op	      16 B/op	       1 allocs/op

pkg: github.com/coredns/coredns/core/dnsserver
BenchmarkCoreServeDNS-4   	 1000000	      1429 ns/op	      16 B/op	       1 allocs/op

master:
pkg: github.com/coredns/coredns/core/dnsserver
BenchmarkCoreServeDNS-4   	 1000000	      1412 ns/op	      16 B/op	       1 allocs/op

pkg: github.com/coredns/coredns/core/dnsserver
BenchmarkCoreServeDNS-4   	 1000000	      1429 ns/op	      16 B/op	       1 allocs/op
~~~

* README.md updates
2017-10-24 10:16:03 +01:00
Miek Gieben
5f813bcc21 plugin/kubernetes: re-add sleep(3) (#1166)
This flakyness is driving me crazy. Add the sleep(3s) back.
2017-10-23 20:08:58 +01:00
Miek Gieben
4fc381a491 Stalebot (#1165)
* stalebot: use wontfix-stalebot

I've added two new labels: wontfix-stalebot and pinned.

Wontfix-stalebot will be used by stalebot and pinned can be used to keep
issues open.

* later as well
2017-10-23 19:46:18 +01:00
Miek Gieben
5aa0d55e72 plugin/pkg/cache: smarter locking (#1164)
Make the locking slightly smarter in Evict and add benchmark function.

Seems a bit faster (there was some variance while performing these
benchmarks)

Master:
BenchmarkCache-2   	 1000000	      2317 ns/op	       0 B/op	       0 allocs/op
BenchmarkCache-2   	 1000000	      2032 ns/op	       0 B/op	       0 allocs/op

This branch:
BenchmarkCache-2   	 1000000	      1806 ns/op	       0 B/op	       0 allocs/op
BenchmarkCache-2   	 1000000	      1809 ns/op	       0 B/op	       0 allocs/op
2017-10-23 17:24:48 +01:00
Miek Gieben
cb5e82b82e middleware->plugin renaming (#1161)
These file still had middleware in their name, rename to plugin.
2017-10-22 13:56:50 +01:00
Miek Gieben
0af3fbab4f core: add ServeDNS benchmark (#1158)
* core: add ServeDNS benchmark

Add benchmark function so we can perf test future additions to the
servers' ServeDNS function.

* naming
2017-10-21 09:30:59 +01:00
Miek Gieben
d64b684831 plugin/kubernetes: implement HasSynced() (#1155)
* plugin/kubernetes: wait until api is ready

Wait for HasSynced before allowing startup to avoid startup race.

Also do a small refactor in findServices() to pull a check out of the
loop - only needs to be done once.

* sigh
2017-10-20 22:53:17 +01:00
Miek Gieben
c1f67493de docs: less CoreDNS in docs (#1154)
Various other changes.
2017-10-20 09:47:43 +01:00
Miek Gieben
11203e440d plugin/dnssec; insert and sign DS records (#1153)
* plugin/dnssec; insert and sign DS records

Sign a delegation as well and insert DS records.

Fixes #698

* better
2017-10-20 09:22:02 +01:00
Miek Gieben
73d702c052 plugin/metrcs: add env variable example (#1151)
We support ENV variables in config files, add an example in the one for
metric, note that `localhost:` is a valid host (in Go), so the
TestReadme will parse this correctly.

Fixes #1150
2017-10-18 17:20:27 +01:00
Miek Gieben
4d6e9c3833 Release 0.9.9 2017-10-18 10:20:41 +00:00
Sandeep Rajan
b6b05eae8f Plugin/Kubernetes: Service and Endpoint Indexing (#1149)
* indexing

* corrections
2017-10-17 21:30:54 -04:00
Miek Gieben
0c63248a0e plugin/autopath: move after cache (#1147) 2017-10-17 20:09:25 -04:00
Miek Gieben
ea10a0d2f6 Don't number the plugins (#1146)
* Don't number the plugins

The number is not needed, because the ordering is already specified.
It's also annoying when you move plugins, because you need to renumber
them. Remove this.

'go gen' shows no changes in the generated files, meaning this just
works.

* better naming
2017-10-16 10:49:18 +02:00
Miek Gieben
70ee39844e plugin/autopath: Add metrics and remove log line (#1143)
* plugin/autopath: Add namespace selector and metrics

Add a namespace, so autopathing only is performed in this namespace.
This will make caching work for the cluster again.

Also export metrics that we've done a successful autopath

* dont shadow

* Fix

* Back the namespacing changes
2017-10-15 19:39:24 +02:00