aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-02-24plugin/kubernetes: create dns.Msg later (#2604)Gravatar Miek Gieben 1-18/+16
There is no need to do this at the top of the handler, move this down into the function. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-02-21Fix some typos in documents (#2592)Gravatar Xiao An 1-1/+1
Signed-off-by: Xiao An <hac@zju.edu.cn>
2019-02-20Fix typos (#2584)Gravatar Guillaume Gelin 1-2/+2
2019-02-20Remove some duplicate worlds (#2582)Gravatar Nguyen Phuong An 1-1/+1
Signed-off-by: Nguyen Phuong An <AnNP@vn.fujitsu.com>
2019-02-17cleanup by fmt and remove redundant type declarations (#2563)Gravatar Sandeep Rajan 3-8/+8
2019-02-17Fix some typos (#2560)Gravatar Nguyen Quang Huy 1-1/+1
* Fix some typos Corect some words for reading more easily * Update NOERROR response code NOERROR is a response code so I revert the typo checking for it
2019-02-14Change http to https for security links (#2559)Gravatar Nguyen Van Trung 1-2/+2
Signed-off-by: Nguyen Van Trung <trungnv@vn.fujitsu.com>
2019-02-11Remove grpc watch functionality (#2549)Gravatar Miek Gieben 10-402/+30
This was added, but didn't see any use. For a large, complex chunk of code we should have some users of it. Remove all watch functionally from plugins, servers and packages. Fixes: #2548 Signed-off-by: Miek Gieben <miek@miek.nl>
2019-02-07Set klog's logtostderr flag (#2529)Gravatar Guy Templeton 1-2/+8
* Parse as well as setlogtostderr flag * Enforce setting of logtostderr for klog * Clearup comment on klog
2019-01-29skip pushing watch updates when there are no watches (#2513)Gravatar Chris O'Haver 1-0/+12
2019-01-23Update README.md (#2490)Gravatar Chris O'Haver 1-2/+2
2019-01-19Stop importing testing in the main binary (#2479)Gravatar Miek Gieben 9-17/+40
* Stop importing testing in the main binary Stop importing "testing" into the main binary: * test/helpers.go imported it; remote that and change function signature * update all tests that use this Signed-off-by: Miek Gieben <miek@miek.nl> * Drop import testing from metrics plugin Signed-off-by: Miek Gieben <miek@miek.nl> * more fiddling Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-19set ttl for ns records (#2452)Gravatar Chris O'Haver 2-9/+9
2019-01-13Deprecate multiple endpoints for out-of-cluster k8s api (#2454)Gravatar Yong Tang 4-72/+6
This fix deprecates endpoints for out-of-cluster k8s api, The Corefile still takes multiple endpoints though only the first one is used. A warning is shown if there are multiple endpoints. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-01-13Fix setup_test in plugin/kubernetes (#2460)Gravatar Miek Gieben 1-1/+0
PR race condition, fix the test data for the setup. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-13Default to upstream to self (#2436)Gravatar Miek Gieben 3-78/+4
* Default to upstream to self This is a backwards incompatible change. This is a massive (cleanup) PR where we default to resolving external names by the coredns process itself, instead of directly forwarding them to some upstream. This ignores any arguments `upstream` may have had and makes it depend on proxy/forward configuration in the Corefile. This allows resolved upstream names to be cached and we have better healthchecking of the upstreams. It also means there is only one way to resolve names, by either using the proxy or forward plugin. The proxy/forward lookup.go functions have been removed. This also lessen the dependency on proxy, meaning deprecating proxy will become easier. Some tests have been removed as well, or moved to the top-level test directory as they now require a full coredns process instead of just the plugin. For the etcd plugin, the entire StubZone resolving is *dropped*! This was a hacky (but working) solution to say the least. If someone cares deeply it can be brought back (maybe)? The pkg/upstream is now very small and almost does nothing. Also the New() function was changed to return a pointer to upstream.Upstream. It also returns only one parameter, so any stragglers using it will encounter a compile error. All documentation has been adapted. This affected the following plugins: * etcd * file * auto * secondary * federation * template * route53 A followup PR will make any upstream directives with arguments an error, right now they are ignored. Signed-off-by: Miek Gieben <miek@miek.nl> * Fix etcd build - probably still fails unit test Signed-off-by: Miek Gieben <miek@miek.nl> * Slightly smarter lookup check in upstream Signed-off-by: Miek Gieben <miek@miek.nl> * Compilez Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-10fix soa min ttl in tests cases (#2451)Gravatar Chris O'Haver 7-30/+30
2019-01-10set minttl to ttl setting (#2446)Gravatar Chris O'Haver 8-31/+31
2019-01-08plugin/kubernetes: fix case preservation and add test (#2430)Gravatar Chris O'Haver 2-2/+74
* fix case preservation and add test * only fix case in k8s
2019-01-07Error out when multiple https endpoints are specified. (#2438)Gravatar Yong Tang 3-2/+26
This fix will error out when multiple https endpoints are specified, as additional work is needed to support beyond http. This fix fixes 1464. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-01-05plugin/kubernetes: add memory usage guidelines (#2424)Gravatar Miek Gieben 1-0/+15
Add words in object.go on the memory use and put some future ideas in there to use even less (if we have to at some point). Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-30disable ra flag for several plugins (#2408)Gravatar Isolus 1-1/+1
* disable ra flag for several plugins * removed unnecessary assignment * removed more unnecessary assignments
2018-12-14Add new plugin: external - resolve k8s ingress and LB address with external ↵Gravatar Miek Gieben 5-1/+252
names (#2379) * 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>
2018-12-10map bool -> map struct{} (#2386)Gravatar Miek Gieben 1-2/+2
This clear out the remaining map[x]bool usage and moves the bool to an empty struct. Two note worthy other changes: * EnableChaos in the server is now also exported to make it show up in the documentation. * The auto plugin is left as is, because there the boolean is explicitaly set to false to signal 'to-be-deleted' and the key is left as-is. Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-08plugin/kubernetes: smaller map (#2383)Gravatar Miek Gieben 4-7/+7
* plugin/kubernetes: smaller map to continue with a theme: the map[string]bool can be reduced to map[string]struct{} to reduce a tiny amount of memory. Signed-off-by: Miek Gieben <miek@miek.nl> * fix tests Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-08plugin/kubernetes: make prefix key in msg.Service a const (#2378)Gravatar Miek Gieben 2-9/+11
This is a relic from the etcd integration and only used to remove in the final answer returned to the client. We do need it. Make it a constant and only one character wide. Signed-off-by: Miek Gieben <miek@miek.nl>
2018-11-30allow ttl 0 (#2348)Gravatar Chris O'Haver 2-3/+3
2018-11-27Update README.md (#2341)Gravatar Cricket Liu 1-22/+22
Miscellaneous textual cleanup.
2018-11-16Set SOA record TTL as min of TTL/MINIMUM (#2295)Gravatar stuart nelson 6-25/+25
* Set SOA record TTL as min of TTL/MINIMUM According to https://tools.ietf.org/html/rfc2308#section-3: The TTL of this record is set from the minimum of the MINIMUM field of the SOA record and the TTL of the SOA itself, and indicates how long a resolver may cache the negative answer. Set the TTL accordingly so as to not always negative cache SOA records for 300 seconds. * Inline min func * Update SOA record tests * Fix types
2018-11-13plugin/kubernetes: Validate transfers are allowed (#2292)Gravatar Chris O'Haver 3-2/+105
* check allowed transfers * add tests for parsing, and comment about refactor
2018-11-12dont log error for non existant txt records (#2291)Gravatar Chris O'Haver 1-1/+1
2018-11-08add missed kubernetes option to syntax box (#2281)Gravatar DavadDi 1-0/+2
2018-11-07add opts.initPodCache to avoid panic (#2279)Gravatar DavadDi 1-0/+11
Automatically submitted.
2018-10-30Update README.md (#2253)Gravatar Francois Tur 1-0/+1
2018-10-22Unblock startup if kubernetes API is unavailable (#2126)Gravatar Kevin Nisbet 3-8/+67
2018-10-17kubernetes: fix the type (#2208)Gravatar Miek Gieben 1-2/+2
client-go is a "empty interface" waste-land and we're missing an integration test so we didn't catch. Try this. Signed-off-by: Miek Gieben <miek@miek.nl>
2018-10-11Revert "use keys (#2167)" (#2188)Gravatar Miek Gieben 12-275/+367
This reverts commit 974ed086f25ad45a01947e276e2eb8aa73d007a3.
2018-10-10use keys (#2167)Gravatar Chris O'Haver 12-367/+275
2018-10-09plugin/kubernetes: allow trimming down of cached items. (#2128)Gravatar Miek Gieben 20-866/+1093
* Convert to runtime.Object to smaller structs This adds conversion for all the objects we want to keep in the cache. It keeps the minimum for CoreDNS to function and throws away the rest. The conversion: api.Endpoints -> object.Endpoints api.Pod -> object.Pod api.Serivce -> object.Service We needed to copy some client-go stuff to insert a conversion function into NewIndexInformers. Some unrelated cleanups in the watch functionality as that needed to be touched because of the above translation of objects. Signed-off-by: Miek Gieben <miek@miek.nl> * Reduce test line-count Signed-off-by: Miek Gieben <miek@miek.nl> * ....and fix test Signed-off-by: Miek Gieben <miek@miek.nl> * Drop use of append Signed-off-by: Miek Gieben <miek@miek.nl> * cosmetic changes Signed-off-by: Miek Gieben <miek@miek.nl> * that was a typo Signed-off-by: Miek Gieben <miek@miek.nl> * re-introduce append here We can't really use len() here because we don't know the number before hand. Signed-off-by: Miek Gieben <miek@miek.nl> * comment in better place Signed-off-by: Miek Gieben <miek@miek.nl> * Make the timestamp a bool; thats where it is used for Signed-off-by: Miek Gieben <miek@miek.nl> * Set incoming object to nil Explicataliy discard the converted object; we did a deep copy it's not needed anymore. Signed-off-by: Miek Gieben <miek@miek.nl> * Per Chris's comment Signed-off-by: Miek Gieben <miek@miek.nl>
2018-10-02Add Kubernetes auth providers (#2147)Gravatar John Belamaric 1-0/+8
* Import auth providers for K8s * Vendor updates for K8s auth providers * Remove Azure since it is not compiling * Update vendor to remove Azure dependencies
2018-09-29Benchmark for k8s services (#2107)Gravatar Brad Beam 2-10/+169
* Benchmark for k8s services * Adding k8s.io/client-go/kubernetes/fake dep
2018-09-28Support for kubeconfig files (#2053)Gravatar Zach Eddy 4-0/+59
* Add support for authentication with kubeconfig files * Update k8s plugin documentation * Fix whitespace in README and tests * Use clientcmd package to load kubeconfig file
2018-09-22plugin/kubernetes: use struct{} was map values (#2125)Gravatar Miek Gieben 1-3/+3
This takes less space than a bool, the value isn't used for anything else than "present in map" any way. Signed-off-by: Miek Gieben <miek@miek.nl>
2018-09-22plugin/kubernetes: remove unnecessary checks (#2124)Gravatar Miek Gieben 1-39/+13
These checks are not needed and also use a var for all obj errors. Signed-off-by: Miek Gieben <miek@miek.nl>
2018-09-22plugin/kubernetes: remove var namespace (#2122)Gravatar Miek Gieben 2-9/+7
* WIP: trying stuff out Signed-off-by: Miek Gieben <miek@miek.nl> * Fixes Signed-off-by: Miek Gieben <miek@miek.nl> * Revert "WIP: trying stuff out" This reverts commit a18a6ae1233d5f34c98164fd693294c36b3240b7.
2018-09-22K8s remove string ops (#2119)Gravatar Miek Gieben 3-32/+20
* plugin/kubernetes: remove bunch a string ops This removes a bunch of appends to where not needed, makes dnsutil.Join take variadic args which removes the need to wrap in a new string slice. Signed-off-by: Miek Gieben <miek@miek.nl> * Fix calls to dnsutil.Join Signed-off-by: Miek Gieben <miek@miek.nl> * Revert these Signed-off-by: Miek Gieben <miek@miek.nl>
2018-09-19Cleanup ParseHostOrFile (#2100)Gravatar Miek Gieben 1-1/+1
Create plugin/pkg/transport that holds the transport related functions. This needed to be a new pkg to prevent cyclic import errors. This cleans up a bunch of duplicated code in core/dnsserver that also tried to parse a transport (now all done in transport.Parse). Signed-off-by: Miek Gieben <miek@miek.nl>
2018-09-12plugin/federation: handle missing avail-zone/region labels better (#2092)Gravatar Chris O'Haver 1-0/+6
* handle missing avail-zone/region labels better * oops forgot a file
2018-08-29Default to scrubbing replies in the server (#2012)Gravatar Miek Gieben 1-2/+0
Every plugin needs to deal with EDNS0 and should call Scrub to make a message fit the client's buffer. Move this functionality into the server and wrapping the ResponseWriter into a ScrubWriter that handles these bits for us. Result: Less code and faster, because multiple chained plugins could all be calling scrub and SizeAndDo - now there is just one place. Most tests in file/* and dnssec/* needed adjusting because in those unit tests you don't see OPT RRs anymore. The DNSSEC signer was also looking at the returned OPT RR to see if it needed to sign - as those are now added by the server (and thus later), this needed to change slightly. Scrub itself still exist (for backward compat reasons), but has been made a noop. Scrub has been renamed to scrub as it should not be used by external plugins. Fixes: #2010 Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-27handle blank name and namespaces (#2042)Gravatar Chris O'Haver 4-6/+33