Skip to content

Commit 7c22a03

Browse files
committed
Merge branch 'master' into feat/txt-registry-new-format-only
2 parents c7154c9 + 909519f commit 7c22a03

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+839
-422
lines changed

.github/workflows/lint-test-chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080

8181
- name: Create Kind cluster
8282
if: steps.changes.outputs.changed == 'true'
83-
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
83+
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
8484
with:
8585
wait: 120s
8686

.ko.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
defaultBaseImage: gcr.io/distroless/static-debian11:latest
1+
defaultBaseImage: gcr.io/distroless/static-debian12:latest
22
builds:
33
- env:
44
- CGO_ENABLED=0

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,8 @@ release.prod: test
160160
.PHONY: ko
161161
ko:
162162
scripts/install-ko.sh
163+
164+
# generate-flags-documentation: Generate documentation (docs/flags.md)
165+
.PHONE: generate-flags-documentation
166+
generate-flags-documentation:
167+
go run internal/gen/docs/flags/main.go

docs/faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ $ docker run \
221221
-e EXTERNAL_DNS_SOURCE=$'service\ningress' \
222222
-e EXTERNAL_DNS_PROVIDER=google \
223223
-e EXTERNAL_DNS_DOMAIN_FILTER=$'foo.com\nbar.com' \
224-
registry.k8s.io/external-dns/external-dns:v0.15.0
224+
registry.k8s.io/external-dns/external-dns:v0.15.1
225225
time="2017-08-08T14:10:26Z" level=info msg="config: &{APIServerURL: KubeConfig: Sources:[service ingress] Namespace: ...
226226
```
227227

docs/flags.md

+169
Large diffs are not rendered by default.

docs/registry/dynamodb.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ spec:
8181
spec:
8282
containers:
8383
- name: external-dns
84-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
84+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
8585
args:
8686
- --source=service
8787
- --source=ingress

docs/release.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ You must be an official maintainer of the project to be able to do a release.
3131
- Branch out from the default branch and run `scripts/kustomize-version-updater.sh` to update the image tag used in the kustomization.yaml.
3232
- Create an issue to release the corresponding Helm chart via the chart release process (below) assigned to a chart maintainer
3333
- Create a PR with the kustomize change.
34-
- Create a PR to replace all versions for docker images in the tutorials. A possible script to use is `sd registry.k8s.io/external-dns/external-dns:v0.15.0`
34+
- Create a PR to replace all versions for docker images in the tutorials. A possible script to use is `sd registry.k8s.io/external-dns/external-dns:v0.15.1`
3535
- Once the PR is merged, all is done :-)
3636

3737
## How to release a new chart version

docs/contributing/crd-source.md renamed to docs/sources/crd.md

+67-4
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,18 @@ Create the objects of CRD type by filling in the fields of CRD and DNS record wo
8282

8383
### Example
8484

85-
Here is an example [CRD manifest](crd-source/crd-manifest.yaml) generated by kubebuilder.
85+
Here is an example [CRD manifest](crd/crd-manifest.yaml) generated by kubebuilder.
8686
Apply this to register the CRD
8787

8888
```
89-
$ kubectl apply --validate=false -f docs/contributing/crd-source/crd-manifest.yaml
89+
$ kubectl apply --validate=false -f docs/sources/crd/crd-manifest.yaml
9090
customresourcedefinition.apiextensions.k8s.io "dnsendpoints.externaldns.k8s.io" created
9191
```
9292

93-
Then you can create the dns-endpoint yaml similar to [dnsendpoint-example](crd-source/dnsendpoint-example.yaml)
93+
Then you can create the dns-endpoint yaml similar to [dnsendpoint-example](crd/dnsendpoint-example.yaml)
9494

9595
```
96-
$ kubectl apply -f docs/contributing/crd-source/dnsendpoint-example.yaml
96+
$ kubectl apply -f docs/sources/crd/dnsendpoint-example.yaml
9797
dnsendpoint.externaldns.k8s.io "examplednsrecord" created
9898
```
9999

@@ -107,6 +107,69 @@ INFO[0000] CREATE: foo.bar.com 180 IN A 192.168.99.216
107107
INFO[0000] CREATE: foo.bar.com 0 IN TXT "heritage=external-dns,external-dns/owner=default"
108108
```
109109

110+
#### Using CRD source to manage DNS records in different DNS providers
111+
112+
[CRD source](https://github.com/kubernetes-sigs/external-dns/blob/master/docs/sources/crd.md) provides a generic mechanism and declarative way to manage DNS records in different DNS providers using external-dns.
113+
114+
**Not all the record types are enabled by default so the required record types must be enabled by using `--managed-record-types`.**
115+
116+
```bash
117+
external-dns --source=crd \
118+
--domain-filter=example.com \
119+
--managed-record-types=A \
120+
--managed-record-types=CNAME \
121+
--managed-record-types=NS
122+
```
123+
124+
* Example for record type `A`
125+
126+
```yaml
127+
apiVersion: externaldns.k8s.io/v1alpha1
128+
kind: DNSEndpoint
129+
metadata:
130+
name: examplearecord
131+
spec:
132+
endpoints:
133+
- dnsName: example.com
134+
recordTTL: 60
135+
recordType: A
136+
targets:
137+
- 10.0.0.1
138+
```
139+
140+
* Example for record type `CNAME`
141+
142+
```yaml
143+
apiVersion: externaldns.k8s.io/v1alpha1
144+
kind: DNSEndpoint
145+
metadata:
146+
name: examplecnamerecord
147+
spec:
148+
endpoints:
149+
- dnsName: test-a.example.com
150+
recordTTL: 300
151+
recordType: CNAME
152+
targets:
153+
- example.com
154+
```
155+
156+
* Example for record type `NS`
157+
158+
```yaml
159+
apiVersion: externaldns.k8s.io/v1alpha1
160+
kind: DNSEndpoint
161+
metadata:
162+
name: ns-record
163+
spec:
164+
endpoints:
165+
- dnsName: zone.example.com
166+
recordTTL: 300
167+
recordType: NS
168+
targets:
169+
- ns1.example.com
170+
- ns2.example.com
171+
```
172+
110173
### RBAC configuration
111174

112175
If you use RBAC, extend the `external-dns` ClusterRole with:

docs/sources/gateway-api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ spec:
8787
serviceAccountName: external-dns
8888
containers:
8989
- name: external-dns
90-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
90+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
9191
args:
9292
# Add desired Gateway API Route sources.
9393
- --source=gateway-httproute

docs/sources/gloo-proxy.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ spec:
2222
containers:
2323
- name: external-dns
2424
# update this to the desired external-dns version
25-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
25+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
2626
args:
2727
- --source=gloo-proxy
2828
- --gloo-namespace=custom-gloo-system # gloo system namespace. Specify multiple times for multiple namespaces. Omit to use the default (gloo-system)
@@ -90,7 +90,7 @@ spec:
9090
containers:
9191
- name: external-dns
9292
# update this to the desired external-dns version
93-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
93+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
9494
args:
9595
- --source=gloo-proxy
9696
- --gloo-namespace=custom-gloo-system # gloo system namespace. Specify multiple times for multiple namespaces. Omit to use the default (gloo-system)

docs/sources/istio.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
spec:
3030
containers:
3131
- name: external-dns
32-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
32+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
3333
args:
3434
- --source=service
3535
- --source=ingress
@@ -100,7 +100,7 @@ spec:
100100
serviceAccountName: external-dns
101101
containers:
102102
- name: external-dns
103-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
103+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
104104
args:
105105
- --source=service
106106
- --source=ingress

docs/sources/kong.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
containers:
2525
- name: external-dns
2626
# update this to the desired external-dns version
27-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
27+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
2828
args:
2929
- --source=kong-tcpingress
3030
- --provider=aws
@@ -88,7 +88,7 @@ spec:
8888
containers:
8989
- name: external-dns
9090
# update this to the desired external-dns version
91-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
91+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
9292
args:
9393
- --source=kong-tcpingress
9494
- --provider=aws

docs/sources/mx-record.md

+2-2
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/nodes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ spec:
3232
serviceAccountName: external-dns
3333
containers:
3434
- name: external-dns
35-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
35+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
3636
args:
3737
- --source=node # will use nodes as source
3838
- --provider=aws
@@ -103,7 +103,7 @@ spec:
103103
serviceAccountName: external-dns
104104
containers:
105105
- name: external-dns
106-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
106+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
107107
args:
108108
- --source=node # will use nodes as source
109109
- --provider=aws

docs/sources/ns-record.md

+6
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/openshift.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ spec:
6767
spec:
6868
containers:
6969
- name: external-dns
70-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
70+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
7171
args:
7272
- --source=openshift-route
7373
- --domain-filter=external-dns-test.my-org.com # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
@@ -134,7 +134,7 @@ spec:
134134
serviceAccountName: external-dns
135135
containers:
136136
- name: external-dns
137-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
137+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
138138
args:
139139
- --source=openshift-route
140140
- --domain-filter=external-dns-test.my-org.com # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones

docs/sources/service.md

+11-7
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`
@@ -76,7 +76,7 @@ or the `--publish-host-ip` flag was specified, uses the Pod's `status.hostIP` fi
7676
### ClusterIP (not headless)
7777

7878
1. If the hostname came from an `external-dns.alpha.kubernetes.io/internal-hostname` annotation
79-
or the `--publish-internal-services` flag was specified, uses the `spec.ServiceIP`.
79+
or the `--publish-internal-services` flag was specified, uses the `spec.ClusterIP`.
8080

8181
2. Otherwise, does not create any targets.
8282

@@ -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/traefik-proxy.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
containers:
2525
- name: external-dns
2626
# update this to the desired external-dns version
27-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
27+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
2828
args:
2929
- --source=traefik-proxy
3030
- --provider=aws
@@ -87,7 +87,7 @@ spec:
8787
containers:
8888
- name: external-dns
8989
# update this to the desired external-dns version
90-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
90+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
9191
args:
9292
- --source=traefik-proxy
9393
- --provider=aws

docs/sources/txt-record.md

+2-2
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/akamai-edgedns.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ spec:
104104
serviceAccountName: external-dns
105105
containers:
106106
- name: external-dns
107-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
107+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
108108
args:
109109
- --source=service # or ingress or both
110110
- --provider=akamai
@@ -190,7 +190,7 @@ spec:
190190
serviceAccountName: external-dns
191191
containers:
192192
- name: external-dns
193-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
193+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
194194
args:
195195
- --source=service # or ingress or both
196196
- --provider=akamai

docs/tutorials/alibabacloud.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ spec:
113113
spec:
114114
containers:
115115
- name: external-dns
116-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
116+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
117117
args:
118118
- --source=service
119119
- --source=ingress
@@ -187,7 +187,7 @@ spec:
187187
serviceAccountName: external-dns
188188
containers:
189189
- name: external-dns
190-
image: registry.k8s.io/external-dns/external-dns:v0.15.0
190+
image: registry.k8s.io/external-dns/external-dns:v0.15.1
191191
args:
192192
- --source=service
193193
- --source=ingress

0 commit comments

Comments
 (0)