Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExternalDNS upgraded to v0.14.0 #5

Merged
merged 9 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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