Commit Graph

468 Commits

Author SHA1 Message Date
Michel Loiseleur
3c93bcb076
chore(code): improve some tests + re-order sources flags CLI (#5288)
* fix(plan): always use managed records

* robust random port in test

* use defaultconfig for managed-record-types

* be explicit about static variable

* fix wait

* re-order flags related to sources + dynamic managedrecordtype help

* fix flag doc
2025-04-27 14:11:24 -07:00
Bas Janssen
7a2ba6dec6 Update flags doc in correct location 2025-04-24 16:19:28 +02:00
Markus
c0a9eed521
feat(source): optional exclusion of unschedulable nodes (#5045)
* feat(source/node): Make exclusion of unschedulable Nodes configurable

This fixes a behavioral regression introduced in #4761, where
nodes that were previously added to DNS are removed when they are considered
unschedulable, for example due to automated maintenance tasks.

This change will introduce a new flag called `exclude-unschedulable`, which
defaults to `true` in order to keep in line with the current behavior.
However, it would also be reasonable to restore the initial behavior before

* Allow testing for expected log entries in testNodeSourceEndpoints

This commit adds the required logic to be able to test for
the existence (and absence) of certain log messages
in testNodeSourceEndpoints. As an example, this is implemented
for the tests around excludeUnschedulable.

A side effect of using LogsToBuffer is that tests can't run in
parallel due to the log buffer being shared across all
parallel test cases. As such, these specific tests are now executed
one after another.

* Ensure logging is only hooked for tests that require it

* Document new exclude-unschedulable flag for nodes source
2025-04-07 07:34:40 -07:00
tJouve
1efdf4161c
feat(pihole): add optional support for v6 (#5226)
* Pi hole V6 impl

* Code Review Part One

* Fix Go Lint

* Regenerate Flags file

* Increase code coverage 1/2

* Increase code coverage 2/2

* Fix merge conflict => Provider init move from main.go to execute.go
2025-04-02 09:10:43 -07:00
Michel Loiseleur
3835c62bb6 chore(ci): update linter to v2.0.2 2025-04-02 08:53:54 +02:00
Ivan Ka
65d534e4a1
chore(code-cleanup): move logic away from main.go add tests (#5222)
* feat(code cleanup): remove from main.go

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(code-cleanup): move logic from main.go add tests

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(code-cleanup): move logic from main.go add tests

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(code-cleanup): move logic from main.go add tests

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(code-cleanup): move logic from main.go add tests

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(code-cleanup): move logic away from main.go add tests

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(code-cleanup): move logic away from main.go add tests

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(code-cleanup): move logic away from main.go add tests

Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>

* chore(code-cleanup): move logic away from main.go add tests

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(code-cleanup): move logic away from main.go add tests

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2025-03-31 15:58:43 -07:00
Kubernetes Prow Robot
a2f0f2eb5d
Merge pull request #5192 from hjoshi123/feat-expose-internal-ipv6
feat(source): optional expose of nodes internal ipv6
2025-03-26 15:26:44 -07:00
Ivan Ka
f6d49ddbe8
feat(banner): standardize user agent and output (#5154)
* chore(banner): add banner

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(banner): add banner

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(banner): add banner

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(banner): add banner

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* feat(banner): standartise user agent and output banner

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-03-24 01:16:40 -07:00
hjoshi123
1bf31daf4c
edited docs and made new test 2025-03-19 21:38:52 -06:00
Romain Beuque
ecd57c86f5
feat(ovh): major rewriting of the provider (#5143)
* feat: ovh: improve cache invalidation on errors + dry-run mode + relative CNAME handling + optimization

Signed-off-by: Romain Beuque <556072+rbeuque74@users.noreply.github.com>

* chore: add more tests

Signed-off-by: Romain Beuque <556072+rbeuque74@users.noreply.github.com>

* fix: align cache expiration with Default value

* chore: address comments from review + updated documentation

* chore: address comments from review

---------

Signed-off-by: Romain Beuque <556072+rbeuque74@users.noreply.github.com>
2025-03-17 07:53:49 -07:00
hjoshi123
1fbcb5749a
Merge branch 'master' of github.com:hjoshi123/external-dns into feat-expose-internal-ipv6 2025-03-17 08:39:12 -06:00
hjoshi123
87e3c4bc9c
feat: added expose internal ipv6 flag 2025-03-17 08:37:06 -06:00
Michel Loiseleur
313e15ac2c chore(openstack designate)!: remove in-tree provider 2025-03-15 17:19:10 +01:00
mrozentsvayg
44f1008ee1
cloudflare: bugfix - do not attempt to create unconfigured empty custom hostnames; improve tests; streamline logic (#5146)
improve test coverage

test the edge case when the custom hostname has changed during the record deletion

don't use custom hostnames if Cloudflare for SaaS fails to authenticate

Use new --cloudflare-custom-hostnames flag to enable cloudflare custom hostnames support

custom hostnames flags --cloudflare-custom-hostnames-min-tls-version and --cloudflare-custom-hostnames-certificate-authority support

markdown lint

Update cloudflare.md
2025-03-12 09:59:48 -07:00
Steven Kreitzer
724b86b8b8
feat(source): fitler by gateway name (#5160)
* feat: filter by gateway name

Signed-off-by: Steven Kreitzer <skre@skre.me>

* address comments

* address comments

* address comments

---------

Signed-off-by: Steven Kreitzer <skre@skre.me>
2025-03-12 01:51:47 -07:00
Ivan Ka
1e8e5e06c5
chore(docs): generate docs/monitoring/metrics.md file (#5117)
* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(docs): generate docs/monitoring/metrics.md file

Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2025-03-04 05:05:44 -08:00
Dan Markhasin
dbe32272fc Merge branch 'master' into endpoints-informer
# Conflicts:
#	docs/sources/service.md
2025-02-10 22:49:31 +02:00
Ivan Ka
e7ff1c9c44
docs: update and refactor contribution part (#5073)
* docs: added contribution docs

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* docs: added contribution docs

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* docs: added contribution docs

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* docs: added contribution docs

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* Apply suggestions from code review

Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>

* docs: added contribution docs

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2025-02-08 08:35:56 -08:00
Dan Markhasin
87464189b3 Enable reconcile on endpoint events 2025-02-02 23:42:50 +02:00
Jeremy-Boyle
6e3bfd51d7
Fixing CI due to improper rebase. 2025-01-28 17:34:38 -06:00
Jeremy-Boyle
4a1fd56ed6
Updating flags to be a little more consise and fix build ci issue. 2025-01-28 17:14:59 -06:00
Jeremy-Boyle
2152ec17e2
Rebase off main, and fix tests
Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>
2025-01-28 17:14:59 -06:00
Jeremy-Boyle
781eb5c8ef
Added init work to support RFC2136 multiple hosts.
Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

Fixed go tests, added checks to ensure multiple hosts, and RFC2136LoadBalancingStrategy is set and can be overritten

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

Documentation to support Multiple Hosts and Load Balancing features

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

WIP, counter not working correctly

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

Make pointers to the rfc2136 provider, fixed counter issue, log out last error.

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

Fix error with failover not working correctly

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

Repoint makefile us.gcr.io/k8s-artifacts-prod/external-dns

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

Repoint makefile us.gcr.io/k8s-artifacts-prod/external-dns

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

Fix changes that arent related directly to this PR

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

Changed comment message details for counter

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>
2025-01-28 17:06:41 -06:00
Kubernetes Prow Robot
a61780280d
Merge pull request #4782 from foyerunix/reverse-for-all-pods
feat(source): allow to register all pods and their associated PTR record
2025-01-28 07:51:24 -08:00
Malthe Poulsen
cd624b6f55
feat(txt-registry): add option to use only new format (#4946)
* feat: add option to use only new format TXT records

* add flag and docs

* refine documentation on how to use the flag

* add section regarding manual migration

* update documentation to be same as in types.go

* fix compile issue

* add tests for new flag

* update flags documentation correctly

* add new option to helm chart

* run helm-docs

* remove unessery newline

* add entry to unreleased chart items

* Revert "run helm-docs"

This reverts commit a1d64bd3e8.

* Revert "add new option to helm chart"

This reverts commit 299d087917.

* Revert "add entry to unreleased chart items"

This reverts commit 0bcd0e3612.

* fix test cases that have changed
2025-01-28 03:21:23 -08:00
visokoo
429400ac66
Merge branch 'kubernetes-sigs:master' into add-f5-transport-server-source 2025-01-21 10:06:54 -08:00
foyerunix
bf8c4c0ba6 Allow to register all pods and their associated PTR record
Add two new options:
- --ignore-non-host-network-pods
- --pod-source-domain

Combined toghether, they can be used to register the IPs
of all pods with their associated PTR record.

Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2025-01-14 07:23:38 +00:00
ivan katliarchuk
8de0c39248
chore(docs): docs/flags.md generation
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2024-12-30 13:21:54 +00:00
Vivian Ta
2ea4a15075 feat: Add F5 TransportServer source 2024-11-28 22:51:18 -08:00
Andrew Hay
3b5ef9733b
Merge branch 'master' into cloudflare/region 2024-11-01 10:39:22 -04:00
Kubernetes Prow Robot
b834fef2b7
Merge pull request #4745 from github-vincent-miszczak/aws-sd-tags
feat(aws-sd): tag services
2024-10-19 22:33:04 +01:00
tanujd11
faced93ba2 feature: add azure zone list cache
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
2024-10-16 16:48:42 +05:30
Andrew Hay
1e35134563 fix: add remove default from minimal config 2024-10-11 15:31:33 +00:00
Kubernetes Prow Robot
b024fc9237
Merge pull request #4706 from iul1an/hide-AWSAssumeRoleExternalID
Do not expose the AWS role external id in the logs
2024-10-10 15:20:24 +01:00
Vincent Miszczak
ad744bda83
Merge branch 'kubernetes-sigs:master' into aws-sd-tags 2024-10-07 10:20:22 +02:00
Raffaele Di Fazio
59fe374d79 removes deprecated rdns provider
Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>
2024-10-03 18:48:29 +02:00
romeroalx
1a909b871d pdns provider: added optional argument to make server_id configurable 2024-09-17 20:43:45 +02:00
Vincent Miszczak
7664cea905 feat: aws-sd tags 2024-09-16 14:56:43 +02:00
Andrew Hay
e0cc26247f fix: add region to changes function 2024-09-09 01:28:41 +00:00
Iulian Mandache
90c15d73e8 Do not expose the AWS role external id in the logs 2024-09-08 02:13:22 +03:00
Andrew Hay
2227d22aa7
Merge branch 'master' into cloudflare/region 2024-09-06 15:10:04 -04:00
Kubernetes Prow Robot
848e309ad4
Merge pull request #4593 from johannwagner/feature/nat64
feat: NAT64 network source
2024-09-05 14:34:29 +01:00
Michel Loiseleur
9ceca8fa81
review with Raffo 2024-09-04 13:51:29 +02:00
Michel Loiseleur
74a8cdad85
chore: remove unmaintained providers 2024-09-03 08:53:23 +02:00
Kyle
38178940a3
feat: add annotation and label filters to Ambassador Host Source (#2633)
* Add annotation filter to Ambassador Host Source

This change makes the Ambassador Host source respect the External-DNS annotationFilter allowing for an Ambassador Host resource to specify what External-DNS deployment to use when there are multiple External-DNS deployments within the same cluster. Before this change if you had two External-DNS deployments within the cluster and used the Ambassador Host source the first External-DNS to process the resource will create the record and not the one that was specified in the filter annotation.

I added the `filterByAnnotations` function so that it matched the same way the other sources have implemented annotation filtering. I didn't add the controller check only because I wanted to keep this change to implementing the annotationFilter.

Example: Create two External-DNS deployments 1 public and 1 private and set the Ambassador Host to use the public External-DNS using the annotation filter.

```
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: external-dns-private
spec:
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: external-dns-private
  template:
    metadata:
      labels:
        app: external-dns-private
      annotations:
        iam.amazonaws.com/role: {ARN} # AWS ARN role
    spec:
      serviceAccountName: external-dns
      containers:
      - name: external-dns
        image: k8s.gcr.io/external-dns/external-dns:latest
        args:
        - --source=ambassador-host
        - --domain-filter=example.net # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
        - --provider=aws
        - --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
        - --aws-zone-type=private # only look at public hosted zones (valid values are public, private or no value for both)
        - --registry=txt
        - --txt-owner-id= {Hosted Zone ID} # Insert Route53 Hosted Zone ID here
        - --annotation-filter=kubernetes.io/ingress.class in (private)
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: external-dns-public
spec:
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: external-dns-public
  template:
    metadata:
      labels:
        app: external-dns-public
      annotations:
        iam.amazonaws.com/role: {ARN} # AWS ARN role
    spec:
      serviceAccountName: external-dns
      containers:
      - name: external-dns
        image: k8s.gcr.io/external-dns/external-dns:latest
        args:
        - --source=ambassador-host
        - --domain-filter=example.net # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
        - --provider=aws
        - --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
        - --aws-zone-type= # only look at public hosted zones (valid values are public, private or no value for both)
        - --registry=txt
        - --txt-owner-id= {Hosted Zone ID} # Insert Route53 Hosted Zone ID here
        - --annotation-filter=kubernetes.io/ingress.class in (public)
---
apiVersion: getambassador.io/v3alpha1
  kind: Host
  metadata:
    name: your-hostname
    annotations:
      external-dns.ambassador-service: emissary-ingress/emissary
      kubernetes.io/ingress.class: public
  spec:
		acmeProvider:
      authority: none
		hostname: your-hostname.example.com
```

Fixes kubernetes-sigs/external-dns#2632

* Add Label filltering for Ambassador Host source

Currently the `--label-filter` flag can only be used to filter CRDs, Ingress, Service and Openshift Route objects which match the label selector passed through that flag. This change extends the functionality to the Ambassador Host type object.

When the flag is not specified the default value is `labels.Everything()` which is an empty string, the same as before. An annotation based filter is inefficient because the filtering has to be done in the controller instead of the API server like with label filtering. The Annotation based filtering has been left in for legacy reasons so the Ambassador Host source can be used inconjunction with the other sources that don't yet support label filltering.

It is possible to use label based filltering with annotation based filltering so you can initially filter by label then filter the returned hosts by annotation. This is not recomended

* Update Ambassador Host source docs

Add that the Ambassador Host source now supports both annotation and label filltering.
2024-08-28 18:02:57 +01:00
Johann Wagner
b8e018caaf Introduced NAT64 prefix rewriting 2024-08-19 08:00:18 +02:00
Thibault Jamet
b2ff1619f5
Add Domain filter interface 2024-08-14 10:20:59 +02:00
Thibault Jamet
089744c6ff
Add cache at provider level
**Description**

In the current implementation, DNS providers are called to list all
records on every loop. This is expensive in terms of number of requests
to the provider and may result in being rate limited, as reported in 1293
and 3397.

In our case, we have approximately 20,000 records in our AWS Hosted Zone.
The ListResourceRecordSets API call allows a maximum of 300 items per call.
That requires 67 API calls per external-dns deployment during every sync period

With this, we introduce an optional generic caching mechanism at the provider
level, that re-uses the latest known list of records for a given time.

This prevents from expensive Provider calls to list all records for each
object modification that does not change the actual record (annotations,
statuses, ingress routing, ...)

This introduces 2 trade-offs:

1. Any changes or corruption directly on the provider side will be
longer to detect and to resolve, up to the cache time

2. Any conflicting records in the DNS provider (such as a different
external-dns instance) injected during the cache validity will cause
the first iteration of the next reconcile loop to fail, and hence add a
delay until the next retry

**Checklist**

- [X] Unit tests updated
- [X] End user documentation updated

Change-Id: I0bdcfa994ac1b76acedb05d458a97c080284c5aa
2024-08-14 10:20:56 +02:00
Andrew Hay
d8ec9354da fix: add flag declaration 2024-08-05 19:23:48 +00:00
Andrew Hay
a6590dee09 add test 2024-08-01 19:32:49 +00:00