Skip to content

Commit ee79d0d

Browse files
committed
Improve sources' docs to mention '--managed-record-types'
* Also add some CRD examples for AWS and Cloudflare
1 parent b2e1a60 commit ee79d0d

File tree

7 files changed

+155
-18
lines changed

7 files changed

+155
-18
lines changed

docs/sources/mx-record.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
You can create and manage MX records with the help of [CRD source](../contributing/crd-source.md)
44
and `DNSEndpoint` CRD. Currently, this feature is only supported by `aws`, `azure`, `google` and `digitalocean` providers.
55

6-
In order to start managing MX records you need to set the `--managed-record-types MX` flag.
6+
In order to start managing MX records you need to set the `--managed-record-types=MX` flag.
77

88
```console
9-
external-dns --source crd --provider {aws|azure|google|digitalocean} --managed-record-types A --managed-record-types CNAME --managed-record-types MX
9+
external-dns --source crd --provider {aws|azure|google|digitalocean} --managed-record-types=A --managed-record-types=CNAME --managed-record-types=MX
1010
```
1111

1212
Targets within the CRD need to be specified according to the RFC 1034 (section 3.6.1). Below is an example of

docs/sources/ns-record.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
You can create NS records with the help of [CRD source](../contributing/crd-source.md)
44
and `DNSEndpoint` CRD.
55

6+
In order to start managing NS records you need to set the `--managed-record-types=NS` flag.
7+
8+
```console
9+
external-dns --source crd --managed-record-types=A --managed-record-types=CNAME --managed-record-types=NS
10+
```
11+
612
Consider the following example
713

814
```yaml

docs/sources/service.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ the value of the Pod's `spec.hostname` field and a `.`.
3535

3636
## Targets
3737

38-
If the Service has an `external-dns.alpha.kubernetes.io/target` annotation, uses
38+
If the Service has an `external-dns.alpha.kubernetes.io/target` annotation, uses
3939
the values from that. Otherwise, the targets of the DNS entries created from a service are sourced depending
4040
on the Service's `spec.type`:
4141

@@ -61,7 +61,7 @@ also iterates over the Endpoints's `subsets.notReadyAddresses`.
6161

6262
1. If an address does not target a `Pod` that matches the Service's `spec.selector`, it is ignored.
6363

64-
2. If the target pod has an `external-dns.alpha.kubernetes.io/target` annotation, uses
64+
2. If the target pod has an `external-dns.alpha.kubernetes.io/target` annotation, uses
6565
the values from that.
6666

6767
3. Otherwise, if the Service has an `external-dns.alpha.kubernetes.io/endpoints-type: NodeExternalIP`
@@ -87,23 +87,27 @@ and has a `status.phase` of `Running`. Otherwise iterates over all Nodes, of any
8787

8888
Iterates over each relevant Node's `status.addresses`:
8989

90-
1. If there is an `external-dns.alpha.kubernetes.io/access: public` annotation on the Service, uses both addresses with
90+
1. If there is an `external-dns.alpha.kubernetes.io/access: public` annotation on the Service, uses both addresses with
9191
a `type` of `ExternalIP` and IPv6 addresses with a `type` of `InternalIP`.
9292

93-
2. Otherwise, if there is an `external-dns.alpha.kubernetes.io/access: private` annotation on the Service, uses addresses with
93+
2. Otherwise, if there is an `external-dns.alpha.kubernetes.io/access: private` annotation on the Service, uses addresses with
9494
a `type` of `InternalIP`.
9595

96-
3. Otherwise, if there is at least one address with a `type` of `ExternalIP`, uses both addresses with
96+
3. Otherwise, if there is at least one address with a `type` of `ExternalIP`, uses both addresses with
9797
a `type` of `ExternalIP` and IPv6 addresses with a `type` of `InternalIP`.
9898

9999
4. Otherwise, uses addresses with a `type` of `InternalIP`.
100100

101101
Also iterates over the Service's `spec.ports`, creating a SRV record for each port which has a `nodePort`.
102102
The SRV record has a service of the Service's `name`, a protocol taken from the port's `protocol` field,
103103
a priority of `0` and a weight of `50`.
104-
In order for SRV records to be created, the `--managed-record-types`must have been specified, including `SRV`
104+
In order for SRV records to be created, the `--managed-record-types` must have been specified, including `SRV`
105105
as one of the values.
106106

107+
```console
108+
external-dns ... --managed-record-types=A --managed-record-types=CNAME --managed-record-types=SRV
109+
```
110+
107111
### ExternalName
108112

109113
1. If the Service has one or more `spec.externalIPs`, uses the values in that field.

docs/sources/txt-record.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
You can create and manage TXT records with the help of [CRD source](../contributing/crd-source.md)
44
and `DNSEndpoint` CRD. Currently, this feature is only supported by `digitalocean` providers.
55

6-
In order to start managing TXT records you need to set the `--managed-record-types TXT` flag.
6+
In order to start managing TXT records you need to set the `--managed-record-types=TXT` flag.
77

88
```console
9-
external-dns --source crd --provider {digitalocean} --managed-record-types A --managed-record-types CNAME --managed-record-types TXT
9+
external-dns --source crd --provider {digitalocean} --managed-record-types=A --managed-record-types=CNAME --managed-record-types=TXT
1010
```
1111

1212
Targets within the CRD need to be specified according to the RFC 1035 (section 3.3.14). Below is an example of

docs/tutorials/aws.md

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,11 @@ kubectl create secret generic external-dns \
233233
Follow the steps under [Deploy ExternalDNS](#deploy-externaldns) using either RBAC or non-RBAC. Make sure to uncomment the section that mounts volumes, so that the credentials can be mounted.
234234

235235
> [!TIP]
236-
> By default ExternalDNS takes the profile named `default` from the credentials file. If you want to use a different
237-
> profile, you can set the environment variable `EXTERNAL_DNS_AWS_PROFILE` to the desired profile name or use the
236+
> By default ExternalDNS takes the profile named `default` from the credentials file. If you want to use a different
237+
> profile, you can set the environment variable `EXTERNAL_DNS_AWS_PROFILE` to the desired profile name or use the
238238
> `--aws-profile` command line argument. It is even possible to use more than one profile at ones, separated by space in
239-
> the environment variable `EXTERNAL_DNS_AWS_PROFILE` or by using `--aws-profile` multiple times. In this case
240-
> ExternalDNS looks for the hosted zones in all profiles and keeps maintaining a mapping table between zone and profile
239+
> the environment variable `EXTERNAL_DNS_AWS_PROFILE` or by using `--aws-profile` multiple times. In this case
240+
> ExternalDNS looks for the hosted zones in all profiles and keeps maintaining a mapping table between zone and profile
241241
> in order to be able to modify the zones in the correct profile.
242242
243243
### IAM Roles for Service Accounts
@@ -987,3 +987,67 @@ There are 3 options to control batch size for AWS provider:
987987

988988
Default values for flags `aws-batch-change-size-bytes` and `aws-batch-change-size-values` are taken from [AWS documentation](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html#limits-api-requests) for Route53 API. **You should not change those values until you really have to.** <br>
989989
Because those limits are in place, `aws-batch-change-size` can be set to any value: Even if your batch size is `4000` records, your change will be split to separate batches due to bytes/values size limits and apply request will be finished without issues.
990+
991+
992+
## Using CRD source to manage DNS records in AWS
993+
994+
[CRD source](https://github.com/kubernetes-sigs/external-dns/blob/master/docs/contributing/crd-source.md) provides a generic mechanism and declarative way to manage DNS records in AWS using external-dns.
995+
996+
**Not all the record types are enabled by default so we must enable the required record types using `--managed-record-types`.**
997+
998+
```bash
999+
external-dns --source=crd --provider=aws \
1000+
--domain-filter=example.com \
1001+
--managed-record-types=A \
1002+
--managed-record-types=CNAME \
1003+
--managed-record-types=NS
1004+
```
1005+
1006+
* Example for record type `A`
1007+
1008+
```yaml
1009+
apiVersion: externaldns.k8s.io/v1alpha1
1010+
kind: DNSEndpoint
1011+
metadata:
1012+
name: examplearecord
1013+
spec:
1014+
endpoints:
1015+
- dnsName: example.com
1016+
recordTTL: 60
1017+
recordType: A
1018+
targets:
1019+
- 10.0.0.1
1020+
```
1021+
1022+
* Example for record type `CNAME`
1023+
1024+
```yaml
1025+
apiVersion: externaldns.k8s.io/v1alpha1
1026+
kind: DNSEndpoint
1027+
metadata:
1028+
name: examplecnamerecord
1029+
spec:
1030+
endpoints:
1031+
- dnsName: test-a.example.com
1032+
recordTTL: 300
1033+
recordType: CNAME
1034+
targets:
1035+
- example.com
1036+
```
1037+
1038+
* Example for record type `NS`
1039+
1040+
```yaml
1041+
apiVersion: externaldns.k8s.io/v1alpha1
1042+
kind: DNSEndpoint
1043+
metadata:
1044+
name: ns-record
1045+
spec:
1046+
endpoints:
1047+
- dnsName: zone.example.com
1048+
recordTTL: 300
1049+
recordType: NS
1050+
targets:
1051+
- ns1.example.com
1052+
- ns2.example.com
1053+
```

docs/tutorials/cloudflare.md

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Then apply one of the following manifests file to deploy ExternalDNS.
5858
Create a values.yaml file to configure ExternalDNS to use CloudFlare as the DNS provider. This file should include the necessary environment variables:
5959

6060
```yaml
61-
provider:
61+
provider:
6262
name: cloudflare
6363
env:
6464
- name: CF_API_KEY
@@ -76,7 +76,7 @@ env:
7676
Use this in your values.yaml, if you are using API Token:
7777
7878
```yaml
79-
provider:
79+
provider:
8080
name: cloudflare
8181
env:
8282
- name: CF_API_TOKEN
@@ -307,3 +307,66 @@ Using the `external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"` annotati
307307
Using the `external-dns.alpha.kubernetes.io/cloudflare-region-key` annotation on your ingress, you can restrict which data centers can decrypt and serve HTTPS traffic. A list of available options can be seen [here](https://developers.cloudflare.com/data-localization/regional-services/get-started/).
308308

309309
If not set the value will default to `global`.
310+
311+
## Using CRD source to manage DNS records in Cloudflare
312+
313+
[CRD source](https://github.com/kubernetes-sigs/external-dns/blob/master/docs/contributing/crd-source.md) provides a generic mechanism and declarative way to manage DNS records in Cloudflare using external-dns.
314+
315+
**Not all the record types are enabled by default so we must enable the required record types using `--managed-record-types`.**
316+
317+
```bash
318+
external-dns --source=crd --provider=cloudflare \
319+
--domain-filter=example.com \
320+
--managed-record-types=A \
321+
--managed-record-types=CNAME \
322+
--managed-record-types=NS
323+
```
324+
325+
* Example for record type `A`
326+
327+
```yaml
328+
apiVersion: externaldns.k8s.io/v1alpha1
329+
kind: DNSEndpoint
330+
metadata:
331+
name: examplearecord
332+
spec:
333+
endpoints:
334+
- dnsName: example.com
335+
recordTTL: 60
336+
recordType: A
337+
targets:
338+
- 10.0.0.1
339+
```
340+
341+
* Example for record type `CNAME`
342+
343+
```yaml
344+
apiVersion: externaldns.k8s.io/v1alpha1
345+
kind: DNSEndpoint
346+
metadata:
347+
name: examplecnamerecord
348+
spec:
349+
endpoints:
350+
- dnsName: test-a.example.com
351+
recordTTL: 300
352+
recordType: CNAME
353+
targets:
354+
- example.com
355+
```
356+
357+
* Example for record type `NS`
358+
359+
```yaml
360+
apiVersion: externaldns.k8s.io/v1alpha1
361+
kind: DNSEndpoint
362+
metadata:
363+
name: ns-record
364+
spec:
365+
endpoints:
366+
- dnsName: zone.example.com
367+
recordTTL: 300
368+
recordType: NS
369+
targets:
370+
- ns1.example.com
371+
- ns2.example.com
372+
```

docs/tutorials/pdns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ $ dig @${PDNS_FQDN} echo.example.com.
178178

179179
[CRD source](https://github.com/kubernetes-sigs/external-dns/blob/master/docs/contributing/crd-source.md) provides a generic mechanism and declarative way to manage DNS records in PowerDNS using external-dns.
180180

181+
Not all the record types are enabled by default so we can enable the required record types using `--managed-record-types`.
182+
181183
```bash
182184
external-dns --source=crd --provider=pdns \
183185
--pdns-server={{ pdns-api-url }} \
@@ -190,8 +192,6 @@ external-dns --source=crd --provider=pdns \
190192
--managed-record-types=SRV
191193
```
192194

193-
Not all the record types are enabled by default so we can enable the required record types using `--managed-record-types`.
194-
195195
* Example for record type `A`
196196

197197
```yaml

0 commit comments

Comments
 (0)