Skip to content

Commit

Permalink
ExternalDNS upgraded to v0.14.0 (#5)
Browse files Browse the repository at this point in the history
# Changes for ExternalDNS v0.14.0

Updated README.md with information concerning the new release of
ExternalDNS and fixed CNAMEs being generated without trailing dots.

- Changed registry for external-dns
- Updated version number in doc
- Updated policy to sync
- Updated instructions in README.md
- Fixed CNAMEs
  • Loading branch information
mconfalonieri authored Nov 11, 2023
1 parent 3ff53da commit c0a557c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ a [sidecar container](https://kubernetes.io/docs/concepts/workloads/pods/#worklo
ExternalDNS pod
using the [Bitnami Helm charts for ExternalDNS](https://github.com/bitnami/charts/tree/main/bitnami/external-dns).

⚠️ Webhooks are still an experimental feature of External DNS. The image used in this configuration example
was created by me from the External DNS master branch to test the webhook.
This notice and configuration file will be updated once a webhook version of External DNS will be released.
⚠️ This webhook requires at least ExternalDNS v0.14.0.

```shell
helm repo add bitnami https://charts.bitnami.com/bitnami
Expand All @@ -41,9 +39,9 @@ You can then create the helm values file, for example

```yaml
image:
registry: docker.io
repository: mconfalonieri/external-dns
tag: v0.13.6-142-gd8f408b8
registry: registry.k8s.io
repository: external-dns/external-dns
tag: v0.14.0

provider: webhook

Expand All @@ -53,7 +51,7 @@ extraArgs:

sidecars:
- name: hetzner-webhook
image: ghcr.io/mconfalonieri/external-dns-hetzner-webhook:v0.5.0
image: ghcr.io/mconfalonieri/external-dns-hetzner-webhook:v0.5.1
ports:
- containerPort: 8888
name: webhook
Expand Down Expand Up @@ -127,15 +125,17 @@ build the filter:
While tweaking the configuration, there are some points to take into
consideration:

- if you are using `--registry=txt` (default) for `external-dns`, remember to
set `--txt-prefix=<prefix>` too, or you will receive a 422 response back when
setting one of the required `TXT` records;
- if `WEBHOOK_HOST` and `HEALTH_HOST` are set to the same address/hostname or
one of them is set to `0.0.0.0` remember to use different ports.
- if your records don't get deleted when applications are uninstalled, you
might want to verify the policy in use for ExternalDNS: if it's `upsert-only`
no deletion will occur. It must be set to `sync` for deletions to be
processed.
processed. Please add the following to `external-dns-hetzner-values.yaml` if
you want this strategy:

```yaml
policy: sync
```
## Development
Expand Down
6 changes: 6 additions & 0 deletions internal/hetzner/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,9 @@ func processCreateActions(
}

for _, target := range ep.Targets {
if ep.RecordType == "CNAME" && !strings.HasSuffix(target, ".") {
target += "."
}
log.WithFields(log.Fields{
"zoneName": zoneName,
"dnsName": ep.DNSName,
Expand Down Expand Up @@ -580,6 +583,9 @@ func processUpdateActions(

// Generate create and delete actions based on existence of a record for each target.
for _, target := range ep.Targets {
if ep.RecordType == "CNAME" && !strings.HasSuffix(target, ".") {
target += "."
}
if record, ok := matchingRecordsByTarget[target]; ok {
log.WithFields(log.Fields{
"zoneName": zoneName,
Expand Down

0 comments on commit c0a557c

Please sign in to comment.