Skip to content

Commit d8b61e6

Browse files
committed
feat: Add Azure DNS metadata (tags) support
1 parent 0c39b6e commit d8b61e6

File tree

7 files changed

+1070
-0
lines changed

7 files changed

+1070
-0
lines changed

docs/annotations/annotations.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ Some providers define their own annotations. Cloud-specific annotations have key
286286
| Cloud | Annotation prefix |
287287
|------------|------------------------------------------------|
288288
| AWS | `external-dns.alpha.kubernetes.io/aws-` |
289+
| Azure | `external-dns.alpha.kubernetes.io/azure-` |
289290
| CloudFlare | `external-dns.alpha.kubernetes.io/cloudflare-` |
290291
| Scaleway | `external-dns.alpha.kubernetes.io/scw-` |
291292

docs/tutorials/azure.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,62 @@ Ensure that your nginx-ingress deployment has the following arg: added to it:
511511

512512
For more details see here: [nginx-ingress external-dns](https://github.com/kubernetes-sigs/external-dns/blob/HEAD/docs/faq.md#why-is-externaldns-only-adding-a-single-ip-address-in-route-53-on-aws-when-using-the-nginx-ingress-controller-how-do-i-get-it-to-use-the-fqdn-of-the-elb-assigned-to-my-nginx-ingress-controller-service-instead)
513513

514+
## DNS Record Metadata (Tags)
515+
516+
External-DNS supports setting Azure resource metadata (tags) on DNS records using annotations on Kubernetes resources.
517+
518+
### Usage with Ingress
519+
520+
```yaml
521+
apiVersion: networking.k8s.io/v1
522+
kind: Ingress
523+
metadata:
524+
name: my-ingress
525+
annotations:
526+
external-dns.alpha.kubernetes.io/azure-metadata-cost-center: "12345"
527+
external-dns.alpha.kubernetes.io/azure-metadata-owner: backend-team
528+
spec:
529+
rules:
530+
- host: app.example.com
531+
http:
532+
paths:
533+
- path: /
534+
pathType: Prefix
535+
backend:
536+
service:
537+
name: my-service
538+
port:
539+
number: 80
540+
```
541+
542+
### Usage with Gateway API (HTTPRoute)
543+
544+
```yaml
545+
apiVersion: gateway.networking.k8s.io/v1
546+
kind: HTTPRoute
547+
metadata:
548+
name: my-route
549+
annotations:
550+
external-dns.alpha.kubernetes.io/azure-metadata-environment: production
551+
external-dns.alpha.kubernetes.io/azure-metadata-app: myapp
552+
spec:
553+
parentRefs:
554+
- name: my-gateway
555+
hostnames:
556+
- "api.example.com"
557+
rules:
558+
- backendRefs:
559+
- name: my-service
560+
port: 8080
561+
```
562+
563+
**Note:** Metadata annotations must be placed directly on each route resource (HTTPRoute, TLSRoute, GRPCRoute, etc.). Gateway annotations are not automatically inherited by routes.
564+
565+
### Annotation Format
566+
567+
Metadata annotations must follow the format:
568+
`external-dns.alpha.kubernetes.io/azure-metadata-<key>: <value>`
569+
514570
## Deploy ExternalDNS
515571

516572
Connect your `kubectl` client to the cluster you want to test ExternalDNS with. Then apply one of the following manifests file to deploy ExternalDNS.

0 commit comments

Comments
 (0)