Merge pull request #1581 from stefanlasiewski/patch-1

Improve documentation about rfc2136 TTLs
This commit is contained in:
Kubernetes Prow Robot 2020-08-17 12:59:30 -07:00 committed by GitHub
commit 1e2b11d3d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,9 +108,29 @@ spec:
serviceName: my-service
servicePort: 8000
```
There are other annotation that can affect the generation of DNS records like
external-dns.alpha.kubernetes.io/ttl. These are beyond the scope of this
tutorial and are covered elsewhere in the docs.
### Custom TTL
The default DNS record TTL (Time-To-Live) is 0 seconds. You can customize this value by setting the annotation `external-dns.alpha.kubernetes.io/ttl`. e.g., modify the service manifest YAML file above:
```
apiVersion: v1
kind: Service
metadata:
name: nginx
annotations:
external-dns.alpha.kubernetes.io/hostname: nginx.external-dns-test.my-org.com
external-dns.alpha.kubernetes.io/ttl: 60
spec:
...
```
This will set the DNS record's TTL to 60 seconds.
A default TTL for all records can be set using the the flag with a time in seconds, minutes or hours, such as `--rfc2136-min-ttl=60s`
There are other annotation that can affect the generation of DNS records, but these are beyond the scope of this
tutorial and are covered in the main documentation.
### Test with external-dns installed on local machine (optional)
You may install external-dns and test on a local machine by running: