Skip to content

Commit 4a0bb33

Browse files
committed
feat: ovh: improve cache invalidation on errors + dry-run mode + relative CNAME handling + optimization
Signed-off-by: Romain Beuque <[email protected]>
1 parent 1e8e5e0 commit 4a0bb33

File tree

8 files changed

+602
-287
lines changed

8 files changed

+602
-287
lines changed

README.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ ExternalDNS allows you to keep selected zones (via `--domain-filter`) synchroniz
5858
- [RFC2136](https://tools.ietf.org/html/rfc2136)
5959
- [NS1](https://ns1.com/)
6060
- [TransIP](https://www.transip.eu/domain-name/)
61-
- [OVH](https://www.ovh.com)
61+
- [OVHcloud](https://www.ovhcloud.com)
6262
- [Scaleway](https://www.scaleway.com)
6363
- [Akamai Edge DNS](https://learn.akamai.com/en-us/products/cloud_security/edge_dns.html)
6464
- [GoDaddy](https://www.godaddy.com)
@@ -86,7 +86,7 @@ See PR #3063 for all the discussions about it.
8686
Known providers using webhooks:
8787

8888
| Provider | Repo |
89-
|-----------------------|----------------------------------------------------------------------|
89+
| --------------------- | -------------------------------------------------------------------- |
9090
| Abion | https://github.com/abiondevelopment/external-dns-webhook-abion |
9191
| Adguard Home Provider | https://github.com/muhlba91/external-dns-provider-adguard |
9292
| Anexia | https://github.com/ProbstenHias/external-dns-anexia-webhook |
@@ -126,35 +126,35 @@ We define the following stability levels for providers:
126126

127127
The following table clarifies the current status of the providers according to the aforementioned stability levels:
128128

129-
| Provider | Status | Maintainers |
130-
| -------- | ------ | ----------- |
131-
| Google Cloud DNS | Stable | |
132-
| AWS Route 53 | Stable | |
133-
| AWS Cloud Map | Beta | |
134-
| Akamai Edge DNS | Beta | |
135-
| AzureDNS | Stable | |
136-
| Civo | Alpha | @alejandrojnm |
137-
| CloudFlare | Beta | |
138-
| DigitalOcean | Alpha | |
139-
| DNSimple | Alpha | |
140-
| OpenStack Designate | Alpha | |
141-
| PowerDNS | Alpha | |
142-
| CoreDNS | Alpha | |
143-
| Exoscale | Alpha | |
144-
| Oracle Cloud Infrastructure DNS | Alpha | |
145-
| Linode DNS | Alpha | |
146-
| RFC2136 | Alpha | |
147-
| NS1 | Alpha | |
148-
| TransIP | Alpha | |
149-
| OVH | Alpha | |
150-
| Scaleway DNS | Alpha | @Sh4d1 |
151-
| UltraDNS | Alpha | |
152-
| GoDaddy | Alpha | |
153-
| Gandi | Alpha | @packi |
154-
| IBMCloud | Alpha | @hughhuangzh |
155-
| TencentCloud | Alpha | @Hyzhou |
156-
| Plural | Alpha | @michaeljguarino |
157-
| Pi-hole | Alpha | @tinyzimmer |
129+
| Provider | Status | Maintainers |
130+
| ------------------------------- | ------ | ---------------- |
131+
| Google Cloud DNS | Stable | |
132+
| AWS Route 53 | Stable | |
133+
| AWS Cloud Map | Beta | |
134+
| Akamai Edge DNS | Beta | |
135+
| AzureDNS | Stable | |
136+
| Civo | Alpha | @alejandrojnm |
137+
| CloudFlare | Beta | |
138+
| DigitalOcean | Alpha | |
139+
| DNSimple | Alpha | |
140+
| OpenStack Designate | Alpha | |
141+
| PowerDNS | Alpha | |
142+
| CoreDNS | Alpha | |
143+
| Exoscale | Alpha | |
144+
| Oracle Cloud Infrastructure DNS | Alpha | |
145+
| Linode DNS | Alpha | |
146+
| RFC2136 | Alpha | |
147+
| NS1 | Alpha | |
148+
| TransIP | Alpha | |
149+
| OVHcloud | Beta | @rbeuque74 |
150+
| Scaleway DNS | Alpha | @Sh4d1 |
151+
| UltraDNS | Alpha | |
152+
| GoDaddy | Alpha | |
153+
| Gandi | Alpha | @packi |
154+
| IBMCloud | Alpha | @hughhuangzh |
155+
| TencentCloud | Alpha | @Hyzhou |
156+
| Plural | Alpha | @michaeljguarino |
157+
| Pi-hole | Alpha | @tinyzimmer |
158158

159159
## Kubernetes version compatibility
160160

@@ -209,7 +209,7 @@ The following tutorials are provided:
209209
- [PowerDNS](docs/tutorials/pdns.md)
210210
- [RFC2136](docs/tutorials/rfc2136.md)
211211
- [TransIP](docs/tutorials/transip.md)
212-
- [OVH](docs/tutorials/ovh.md)
212+
- [OVHcloud](docs/tutorials/ovh.md)
213213
- [Scaleway](docs/tutorials/scaleway.md)
214214
- [UltraDNS](docs/tutorials/ultradns.md)
215215
- [GoDaddy](docs/tutorials/godaddy.md)

docs/flags.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
| `--inmemory-zone=` | Provide a list of pre-configured zones for the inmemory provider; specify multiple times for multiple zones (optional) |
104104
| `--ovh-endpoint="ovh-eu"` | When using the OVH provider, specify the endpoint (default: ovh-eu) |
105105
| `--ovh-api-rate-limit=20` | When using the OVH provider, specify the API request rate limit, X operations by seconds (default: 20) |
106+
| `--[no-]ovh-enable-cname-relative` | When using the OVH provider, specify if CNAME should be treated as relative if target omit the final dot (default: false) |
106107
| `--pdns-server="http://localhost:8081"` | When using the PowerDNS/PDNS provider, specify the URL to the pdns server (required when --provider=pdns) |
107108
| `--pdns-server-id="localhost"` | When using the PowerDNS/PDNS provider, specify the id of the server to retrieve. Should be `localhost` except when the server is behind a proxy (optional when --provider=pdns) (default: localhost) |
108109
| `--pdns-api-key=""` | When using the PowerDNS/PDNS provider, specify the API key to use to authorize requests (required when --provider=pdns) |

docs/tutorials/ovh.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
# OVHcloud
22

33
This tutorial describes how to setup ExternalDNS for use within a
4-
Kubernetes cluster using OVH DNS.
4+
Kubernetes cluster using OVHcloud DNS.
55

66
Make sure to use **>=0.6** version of ExternalDNS for this tutorial.
77

8-
## Creating a zone with OVH DNS
8+
## Creating a zone with OVHcloud DNS
99

10-
If you are new to OVH, we recommend you first read the following
10+
If you are new to OVHcloud, we recommend you first read the following
1111
instructions for creating a zone.
1212

13-
[Creating a zone using the OVH manager](https://docs.ovh.com/gb/en/domains/create_a_dns_zone_for_a_domain_which_is_not_registered_at_ovh/)
13+
[Creating a zone using the OVHcloud Manager](https://help.ovhcloud.com/csm/en-gb-dns-create-dns-zone?id=kb_article_view&sysparm_article=KB0051667/)
1414

15-
[Creating a zone using the OVH API](https://api.ovh.com/console/)
15+
[Creating a zone using the OVHcloud API](https://api.ovh.com/console/)
1616

17-
## Creating OVH Credentials
17+
## Creating OVHcloud Credentials
1818

19-
You first need to create an OVH application.
20-
21-
Using the [OVH documentation](https://docs.ovh.com/gb/en/api/first-steps-with-ovh-api/#advanced-usage-pair-ovhcloud-apis-with-an-application_2) you will have your `Application key` and `Application secret`
19+
You first need to create an OVHcloud application: follow the
20+
[OVHcloud documentation](https://help.ovhcloud.com/csm/en-gb-api-getting-started-ovhcloud-api?id=kb_article_view&sysparm_article=KB0042784#advanced-usage-pair-ovhcloud-apis-with-an-application)
21+
you will have your `Application key` and `Application secret`
2222

2323
And you will need to generate your consumer key, here the permissions needed :
2424

@@ -223,7 +223,7 @@ spec:
223223
224224
**A note about annotations**
225225
226-
Verify that the annotation on the service uses the same hostname as the OVH DNS zone created above. The annotation may also be a subdomain of the DNS zone (e.g. 'www.example.com').
226+
Verify that the annotation on the service uses the same hostname as the OVHcloud DNS zone created above. The annotation may also be a subdomain of the DNS zone (e.g. 'www.example.com').
227227
228228
The TTL annotation can be used to configure the TTL on DNS records managed by ExternalDNS and is optional. If this annotation is not set, the TTL on records managed by ExternalDNS will default to 10.
229229
@@ -235,11 +235,11 @@ ExternalDNS uses the hostname annotation to determine which services should be r
235235
kubectl create -f nginx.yaml
236236
```
237237

238-
Depending on where you run your service, it may take some time for your cloud provider to create an external IP for the service. Once an external IP is assigned, ExternalDNS detects the new service IP address and synchronizes the OVH DNS records.
238+
Depending on where you run your service, it may take some time for your cloud provider to create an external IP for the service. Once an external IP is assigned, ExternalDNS detects the new service IP address and synchronizes the OVHcloud DNS records.
239239

240-
## Verifying OVH DNS records
240+
## Verifying OVHcloud DNS records
241241

242-
Use the OVH manager or API to verify that the A record for your domain shows the external IP address of the services.
242+
Use the OVHcloud manager or API to verify that the A record for your domain shows the external IP address of the services.
243243

244244
## Cleanup
245245

internal/gen/docs/flags/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (f *Flags) addFlag(name, description string) {
4646

4747
// It generates a markdown file
4848
// with the supported flags and writes it to the 'docs/flags.md' file.
49-
// to re-generate `docs/flags.md` execute 'go run internal/gen/main.go'
49+
// to re-generate `docs/flags.md` execute 'go run internal/gen/docs/flags/main.go'
5050
func main() {
5151
testPath, _ := os.Getwd()
5252
path := fmt.Sprintf("%s/docs/flags.md", testPath)

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ func main() {
256256
case "digitalocean":
257257
p, err = digitalocean.NewDigitalOceanProvider(ctx, domainFilter, cfg.DryRun, cfg.DigitalOceanAPIPageSize)
258258
case "ovh":
259-
p, err = ovh.NewOVHProvider(ctx, domainFilter, cfg.OVHEndpoint, cfg.OVHApiRateLimit, cfg.DryRun)
259+
p, err = ovh.NewOVHProvider(ctx, domainFilter, cfg.OVHEndpoint, cfg.OVHApiRateLimit, cfg.OVHEnableCNAMERelative, cfg.DryRun)
260260
case "linode":
261261
p, err = linode.NewLinodeProvider(domainFilter, cfg.DryRun, externaldns.Version)
262262
case "dnsimple":

pkg/apis/externaldns/types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ type Config struct {
127127
InMemoryZones []string
128128
OVHEndpoint string
129129
OVHApiRateLimit int
130+
OVHEnableCNAMERelative bool
130131
PDNSServer string
131132
PDNSServerID string
132133
PDNSAPIKey string `secure:"yes"`
@@ -287,6 +288,7 @@ var defaultConfig = &Config{
287288
InMemoryZones: []string{},
288289
OVHEndpoint: "ovh-eu",
289290
OVHApiRateLimit: 20,
291+
OVHEnableCNAMERelative: false,
290292
PDNSServer: "http://localhost:8081",
291293
PDNSServerID: "localhost",
292294
PDNSAPIKey: "",
@@ -532,6 +534,7 @@ func App(cfg *Config) *kingpin.Application {
532534
app.Flag("inmemory-zone", "Provide a list of pre-configured zones for the inmemory provider; specify multiple times for multiple zones (optional)").Default("").StringsVar(&cfg.InMemoryZones)
533535
app.Flag("ovh-endpoint", "When using the OVH provider, specify the endpoint (default: ovh-eu)").Default(defaultConfig.OVHEndpoint).StringVar(&cfg.OVHEndpoint)
534536
app.Flag("ovh-api-rate-limit", "When using the OVH provider, specify the API request rate limit, X operations by seconds (default: 20)").Default(strconv.Itoa(defaultConfig.OVHApiRateLimit)).IntVar(&cfg.OVHApiRateLimit)
537+
app.Flag("ovh-enable-cname-relative", "When using the OVH provider, specify if CNAME should be treated as relative if target omit the final dot (default: false)").Default(strconv.FormatBool(defaultConfig.OVHEnableCNAMERelative)).BoolVar(&cfg.OVHEnableCNAMERelative)
535538
app.Flag("pdns-server", "When using the PowerDNS/PDNS provider, specify the URL to the pdns server (required when --provider=pdns)").Default(defaultConfig.PDNSServer).StringVar(&cfg.PDNSServer)
536539
app.Flag("pdns-server-id", "When using the PowerDNS/PDNS provider, specify the id of the server to retrieve. Should be `localhost` except when the server is behind a proxy (optional when --provider=pdns) (default: localhost)").Default(defaultConfig.PDNSServerID).StringVar(&cfg.PDNSServerID)
537540
app.Flag("pdns-api-key", "When using the PowerDNS/PDNS provider, specify the API key to use to authorize requests (required when --provider=pdns)").Default(defaultConfig.PDNSAPIKey).StringVar(&cfg.PDNSAPIKey)

0 commit comments

Comments
 (0)