ttl.md 1.65 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Configure DNS record TTL (Time-To-Live)
=======================================

An optional annotation `external-dns.alpha.kubernetes.io/ttl` is available to customize the TTL value of a DNS record.

To configure it, simply annotate a service/ingress, e.g.:

```yaml
apiVersion: v1
kind: Service
metadata:
  annotations:
    external-dns.alpha.kubernetes.io/hostname: nginx.external-dns-test.my-org.com.
    external-dns.alpha.kubernetes.io/ttl: "60"
  ...
```

TTL must be a positive integer encoded as string.

Providers
=========

- [x] AWS (Route53)
- [ ] Azure
- [ ] Cloudflare
26
- [x] DigitalOcean
27
- [x] Google
28
- [ ] InMemory
cliedeman's avatar
cliedeman committed
29
- [x] Linode
Reinier Schoof's avatar
Reinier Schoof committed
30
- [x] TransIP
31 32

PRs welcome!
33 34 35

Notes
=====
Andrew Starr-Bochicchio's avatar
Andrew Starr-Bochicchio committed
36
When the `external-dns.alpha.kubernetes.io/ttl` annotation is not provided, the TTL will default to 0 seconds and `enpoint.TTL.isConfigured()` will be false.
37 38

### AWS Provider
Andrew Starr-Bochicchio's avatar
Andrew Starr-Bochicchio committed
39
The AWS Provider overrides the value to 300s when the TTL is 0.
40 41 42
This value is a constant in the provider code.

### DigitalOcean Provider
Andrew Starr-Bochicchio's avatar
Andrew Starr-Bochicchio committed
43
The DigitalOcean Provider overrides the value to 300s when the TTL is 0.
44 45 46
This value is a constant in the provider code.

### Google Provider
Andrew Starr-Bochicchio's avatar
Andrew Starr-Bochicchio committed
47 48
Previously with the Google Provider, TTL's were hard-coded to 300s.
For safety, the Google Provider overrides the value to 300s when the TTL is 0.
49 50
This value is a constant in the provider code.

Andrew Starr-Bochicchio's avatar
Andrew Starr-Bochicchio committed
51
For the moment, it is impossible to use a TTL value of 0 with the AWS, DigitalOcean, or Google Providers.
52
This behavior may change in the future.
cliedeman's avatar
cliedeman committed
53 54

### Linode Provider
Reinier Schoof's avatar
Reinier Schoof committed
55 56 57 58
The Linode Provider default TTL is used when the TTL is 0. The default is 24 hours

### TransIP Provider
The TransIP Provider minimal TTL is used when the TTL is 0. The minimal TTL is 60s.