Commit Graph

340 Commits

Author SHA1 Message Date
Nick Jüttner
cafe6c08d0 Digital Ocean as a new provider (#171)
* Initial Digital Ocean as a new provider

* chore: vendor dependencies

* Remove zone parameter from ApplyChanges and Records

* fix(digitalocean): fix correct imports, unshadow a variable

* fix(digitalocean): respect domain-filter if provided

* add changes to digital ocean provider from PR review (#3)

* fix tests and bugs in find suitable zones for digital ocean (#5)

* tests failed due to wrong formatting

* add digitalocean integration to the main and more tests

* fix suitable zone for digital ocean
2017-06-16 10:44:03 +02:00
Martin Linkhorst
90604c9dcb Load all known Kubernetes Auth Plugins (#238)
* fix: Load all known Kubernetes Auth Plugins

* chore: vendor CoreOS' oidc library
2017-06-15 18:22:57 +02:00
Yerken
611483d523 remove inmemory provider complex interface (#235) 2017-06-13 13:36:10 +02:00
Peter Huene
3355528c16 Implement Azure DNS provider (#210) (#214)
* vendor Azure Go SDK (#210)

* vendor the Azure Go SDK and dependencies

* add initial Azure DNS provider implementation (#210)

* add 'azure' value to 'provider' command line option
* add 'azure-config-file' command line option
* add 'azure-resource-group' command line option
* implement initial Azure DNS provider

note: azure provider is not yet fully implemented (does not query for existing
records).

tests and documentation are forthcoming.

* add a tutorial for the Azure provider (#210)

* add tutorial for using ExternalDNS with Azure DNS

* finish implementation of Azure DNS provider (#210)

* implement the Records method for the Azure DNS provider

* refactor Azure API interface for future tests (#210)

* make Azure provider use an interface for future unit tests

* add unit tests for the Azure provider (#210)

* test retrieving Azure DNS records.
* test updating and deleting Azure DNS records.
* test dry run for the Azure provider (i.e. noop).
2017-06-02 15:24:52 +02:00
Ian Smith
f06fb65917 Fake source (#205)
* Expose inmemory provider to cli

So we can test `--source fake` without needing to touch AWS/Google.

* Add FakeSource

`external-dns --provider inmemory --source fake --dry-run --once`

OR

`external-dns --provider aws --source fake --fqdn-template <hostname suffix> --dry-run --once`

NB: `--fqdn-template` because otherwise we'll default to creating, e.g.,
`abcd.example.com`, which `--provider aws` filters out because you
likely don't have a Zone for `example.com.`  Could also be resolved by
removing the need to use a real provider; the inmemory provider,
perhaps, though it's not entirely hooked up.

Closes kubernetes-incubator/external-dns#22

* Style feedback from Travis CI

* Improve optionality of kubernetes client

* ref(sources): refactor source registration and lookup to be lazy.

* Revert "ref: refactor source registration/lookup to be lazily initialized"
2017-05-29 13:59:50 +02:00
Martin Linkhorst
a18656f1b0 add client-side metrics for all external calls (#188)
* chore: add instrumented HTTP client library

* feat: add client-side metrics to outgoing HTTP clients
2017-05-22 15:39:59 +02:00
Martin Linkhorst
c12424192d add and use a deduplicating source (#185)
* feat: add and use a deduplicating source

* chore: add log entry when endpoint was deduplicated
2017-05-05 14:59:36 +02:00
Martin Linkhorst
da3c17a65c allow setting flags via env vars (#124)
* feat(config): change defaults, switch flag processing to kingpin

* chore: vendor kingpin as a dependency

* feat(config): auto-detect cluster config from the environment

* chore: clean up definition of flags

* chore: sanitize flags even further

* chore: update changelog with latest flags changes

* fix(aws): fix messed up test name
2017-04-27 13:57:45 +01:00
Yerken
82a172a9f9 minor improvements to logging (#175)
* minor improvements to logging

* chore(*): change log.Infoln to log.Info

* fix: fix incorrect example code
2017-04-26 12:06:16 +02:00
Martin Linkhorst
e5f21ad32a add multi-zone capability to google provider (take 2) (#163)
* feat(google): auto-detect and multiple zone support

* chore: run gofmt with the simplified command

* fix: pass desired domain to google provider

* feat(google): correctly auto-detect records for sub-zones

* chore: update changelog with support for multiple zones in google

* fix(google): don't append traling dot to TXT records

* ref(provider): extract hostname sanitization to general provider
2017-04-25 17:45:36 +02:00
Yerken
25eef9159c [PR-156 follow-up] Generate endpoints hostnames if go-template is specified (#160)
* add --fqdn-template

* add missing ,

* gofmt

* no endpoint creation on empty fqdntemplate

* improve test coverage

* gofmt simple on service_test.go and ingress_test.go

* import package order changed

* gofmt

* refactor to generate template in the source init

* refactor for err handling

* fix service tests

* fix wrong check, check for priorities, mate > template

* fix tests, check for controller annotation in the right place

* add to changelog

* add flag description, improve testing, reorganize imports

* review changes: log the error, use text/template, change func interface
2017-04-18 18:13:08 +02:00
Henning Jacobs
57947e54e4 log config on startup (#161) 2017-04-18 18:10:37 +02:00
Martin Linkhorst
03d76204f9 support multiple hosted zones and automatic lookup (#152)
* feat(aws): support multiple hosted zones and automatic lookup

* chore: run gofmt with the simplified command

* fix(aws): add missing method from google provider

* fix: remove superflous parameter from google provider

* feat: make domain configurable via flag

* fix(aws): remove unused constant

* fix(aws): don't log actions that were filtered out

* feat(aws): detect best possible zone to put dns entries in

* fix(aws): log error instead of failing if a change batch fails

* chore: update changelog with support for multiple zones
2017-04-13 17:57:18 +02:00
Yerken
0b43cf511f cmd flags fixes, fix the bug with multi source (#149) 2017-04-12 18:13:03 +02:00
Martin Linkhorst
644206c952 allow plans to be parameterized via policies (#127)
* feat(plan): allow plans to be parameterized via policies

* fix(controller): set a policy in the controller tests

* chore: allow go tip to fail

* chore: update changelog to include policies

* fix(plan): store a pointer to changes

* fix(controller): don't get address of a pointer
2017-04-12 12:49:11 +02:00
Yerken
98de0142ba kickoff txt registry (#137)
* kickoff txt registry

* fix inmemory dns provider to include recordtype info for validation

* Merge master

* fix ununsed variable in inmemory provider

* add tests for records

* add test for no prefix name formatter

* implement apply changes with tests

* add flag to enable txt registry

* add txt registry to main

* improve sort testing

* filter out non-owned records

* NewEndpoint(...) requires record type

* use newendpoint in aws_test, fix tests

* change suitable type implementation

* fix the test for compatibility component

* change inmemory provider to include recordtype and use suitable type

* fix comments, CNAME should target hostname

* name mapper do not use pointer on struct

* txt prefix - just concatenate, remove spew, fix txt record label

* allow TXT records as result from dns provider

* add changelog

* fix tests

* TXT records need to be enclosed in double quotes
2017-04-11 23:10:38 +02:00
Martin Linkhorst
9d48d89240 feat(source): support services annotated with mate's annotations (#141) 2017-04-10 15:43:41 +02:00
Yerken
9a44453d59 define registry interface (#120)
* define registry interface

* init in-memory registry

* remove ununsed variable, added comments

* add inmemory registry tests

* introduce DNSRecord struct

* use noop registry

* remove zone from registry fields

* replace provider with registry in controller

* move noop registry interface check to test

* remove ownerid from noop registry

* fix: remove dangling empty line

* return provider records directly with noop

* adjust according to pr review

* fix noop tests
2017-04-07 16:00:24 +02:00
Martin Linkhorst
ecdd5bc066 metrics: expose basic golang metrics via prometheus (#132)
* feat: expose basic go metrics via prometheus

* chore: vendor dependencies

* feat(metrics): combine healthz and metrics into single endpoint

* ref(metrics): rename metrics port to address

* docs(metrics): update changelog to include metrics feature

* ref(metrics): consistently rename port to address
2017-04-07 14:11:41 +02:00
Martin Linkhorst
facdea51dd feat: make interval between synchronizations configurable (#123) 2017-04-04 16:14:56 +02:00
Martin Linkhorst
318c6e532c ref(*): rename DNSProvider to just Provider (#101) 2017-03-17 14:35:10 +01:00
Martin Linkhorst
8170947af0 remove provider store and don't initialize each DNS provider (#96)
* fix(dnsprovider): do not always initialize each DNS provider

* fix(dnsprovider): fix unnecessary error return value

* ref(dnsprovider): drop the store and use a simple switch for lookup
2017-03-16 17:10:33 +01:00
Martin Linkhorst
476c3efddf feat: allow to specify providers via the cli (#89) 2017-03-14 14:13:13 +01:00
Martin Linkhorst
e6749c8d3d feat: allow to register and lookup sources by name (#84) 2017-03-14 10:55:12 +01:00
Martin Linkhorst
c3378f7f67 use constructor methods to create sources (#82)
* ref(source): use constructor methods to create sources

* fix: import and use missing package

* fix(source): fix merge conflict with master branch
2017-03-13 14:18:20 +01:00
Mikkel Oscar Lyderik Larsen
6b2b691807 Add tests for Google DNS provider 2017-03-12 20:13:03 +01:00
Martin Linkhorst
7f5b54d1e0 feat: add --version flag (#75) 2017-03-09 18:14:26 +01:00
Martin Linkhorst
7058f6c428 Merge pull request #60 from linki/once
add once flag to exit loop after first sync
2017-03-07 20:04:48 +01:00
Martin Linkhorst
d1a510a402
fix: call RunOnce directly and exit when --once is provided 2017-03-07 16:36:14 +01:00
Martin Linkhorst
78a2b1d8d5
feat: allow passing a namespace that limits found resources 2017-03-06 16:41:14 +01:00
Martin Linkhorst
9338080b29
feat: add once flag to exit loop after first sync 2017-03-06 16:14:29 +01:00
ideahitme
a0b66b91f3 refactor 2017-03-02 16:47:38 +01:00
ideahitme
885b2349e1 better flag parse testing 2017-03-02 15:55:49 +01:00
Martin Linkhorst
99371a1e83 implementation of basic control loop (#40)
* feat(google): add ability to apply changes generated from a plan

* feat(controller): first implementation of controller

* feat: allow to configure in-cluster and kubeconfig

* fix(controller): call RunOnce at the right time and in a loop

* feat(google): add dryRun attribute to Google DNS provider

* fix: use hosted zone id instead of DNS name

* fix(google): stupidly filter by A records for now

* feat: allow specifying the google project and zone

* feat: provide a dry-run flag which defaults to false

* chore: vendor new dependencies

* fix(config): fix failing tests for config object

* ref(controller): return plain value of ApplyChanges

* ref: simplify how to get a valid kubernetes client
2017-03-01 16:17:47 +01:00
Justin Santa Barbara
cb364cdbf7 Move config to apimachinery (#37)
Types that we want to work using apimachinery typically go into
pkg/apis/X, and the validation goes into pkg/apis/X/validation.  We then
add versions into e.g. pkg/apis/X/v1alpha1, but this feels premature at
the moment.

Changing this later is annoyingly difficult, especially in terms of
validation and dependencies.

We will want the apimachinery, so that we can configure from a
configuration file that is versioned.  Hopefully dns-controller won't
end up so complicated that we will require it, but I think there is also
value in following the "standard" patterns for controllers that are
emerging from e.g. ingress.

For a fairly simple example of an API, please consult
https://github.com/kubernetes/kubernetes/tree/master/pkg/apis/certificates
2017-03-01 11:49:02 +01:00
ideahitme
0537b77f16 boilerplate header is newline sensitive -_- 2017-02-21 18:53:50 +01:00
ideahitme
c666bbcb7d add boilerplate header 2017-02-21 18:47:07 +01:00
ideahitme
74a2d8ace7 move config to separate package 2017-02-21 16:15:21 +01:00
ideahitme
13b4c8c094 add config validate tests 2017-02-21 14:32:50 +01:00
ideahitme
c6af349a9b add main, config, termination, healthcheck 2017-02-21 14:10:09 +01:00