documentation

This commit is contained in:
Oleksandr Simonov 2024-08-19 20:38:15 +03:00
parent 9637c58e91
commit 5d7f75bb72
4 changed files with 41 additions and 3 deletions

View File

@ -181,6 +181,7 @@ The following tutorials are provided:
* [NS1](docs/tutorials/ns1.md)
* [NS Record Creation with CRD Source](docs/sources/ns-record.md)
* [MX Record Creation with CRD Source](docs/sources/mx-record.md)
* [TXT Record Creation with CRD Source](docs/sources/txt-record.md)
* [OpenStack Designate](docs/tutorials/designate.md)
* [Oracle Cloud Infrastructure (OCI) DNS](docs/tutorials/oracle.md)
* [PowerDNS](docs/tutorials/pdns.md)

View File

@ -1,12 +1,12 @@
# MX record with CRD source
You can create and manage MX records with the help of [CRD source](../contributing/crd-source.md)
and `DNSEndpoint` CRD. Currently, this feature is only supported by `aws`, `azure`, and `google` providers.
and `DNSEndpoint` CRD. Currently, this feature is only supported by `aws`, `azure`, `google` and `digital_ocean` providers.
In order to start managing MX records you need to set the `--managed-record-types MX` flag.
```console
external-dns --source crd --provider {aws|azure|google} --managed-record-types A --managed-record-types CNAME --managed-record-types MX
external-dns --source crd --provider {aws|azure|google|digital_ocean} --managed-record-types A --managed-record-types CNAME --managed-record-types MX
```
Targets within the CRD need to be specified according to the RFC 1034 (section 3.6.1). Below is an example of

View File

@ -0,0 +1,30 @@
# Creating TXT record with CRD source
You can create and manage TXT records with the help of [CRD source](../contributing/crd-source.md)
and `DNSEndpoint` CRD. Currently, this feature is only supported by `digital_ocean` providers.
In order to start managing MX records you need to set the `--managed-record-types TXT` flag.
```console
external-dns --source crd --provider {digital_ocean} --managed-record-types A --managed-record-types CNAME --managed-record-types TXT
```
Targets within the CRD need to be specified according to the RFC 1035 (section 3.3.14). Below is an example of
`example.com` DNS TXT two records creation.
**NOTE** Current implementation do not support RFC 6763 (section 6).
```yaml
apiVersion: externaldns.k8s.io/v1alpha1
kind: DNSEndpoint
metadata:
name: examplemxrecord
spec:
endpoints:
- dnsName: example.com
recordTTL: 180
recordType: TXT
targets:
- SOMETXT
- ANOTHERTXT
```

View File

@ -813,11 +813,13 @@ func TestDigitalOceanMergeRecordsByNameType(t *testing.T) {
endpoint.NewEndpoint("foo.example.com", "CNAME", "somewhere.out.there.com"),
endpoint.NewEndpoint("bar.example.com", "MX", "10 bar.mx1.com"),
endpoint.NewEndpoint("bar.example.com", "MX", "10 bar.mx2.com"),
endpoint.NewEndpoint("foo.example.com", "TXT", "txtone"),
endpoint.NewEndpoint("foo.example.com", "TXT", "txttwo"),
}
merged := mergeEndpointsByNameType(xs)
assert.Equal(t, 4, len(merged))
assert.Equal(t, 5, len(merged))
sort.SliceStable(merged, func(i, j int) bool {
if merged[i].DNSName != merged[j].DNSName {
return merged[i].DNSName < merged[j].DNSName
@ -841,4 +843,9 @@ func TestDigitalOceanMergeRecordsByNameType(t *testing.T) {
assert.Equal(t, "CNAME", merged[3].RecordType)
assert.Equal(t, 1, len(merged[3].Targets))
assert.Equal(t, "somewhere.out.there.com", merged[3].Targets[0])
assert.Equal(t, "foo.example.com", merged[4].DNSName)
assert.Equal(t, "TXT", merged[4].RecordType)
assert.Equal(t, 2, len(merged[4].Targets))
assert.ElementsMatch(t, []string{"txtone", "txttwo"}, merged[4].Targets)
}