sigs.k8s.io/external-dns@v0.14.1/docs/tutorials/externalname.md (about) 1 # Setting up ExternalDNS for ExternalName Services 2 3 This tutorial describes how to setup ExternalDNS for usage in conjunction with an ExternalName service. 4 5 ## Use cases 6 7 The main use cases that inspired this feature is the necessity for having a subdomain pointing to an external domain. In this scenario, it makes sense for the subdomain to have a CNAME record pointing to the external domain. 8 9 ## Setup 10 11 ### External DNS 12 ```yaml 13 apiVersion: apps/v1 14 kind: Deployment 15 metadata: 16 name: external-dns 17 spec: 18 strategy: 19 type: Recreate 20 selector: 21 matchLabels: 22 app: external-dns 23 template: 24 metadata: 25 labels: 26 app: external-dns 27 spec: 28 containers: 29 - name: external-dns 30 image: registry.k8s.io/external-dns/external-dns:v0.14.0 31 args: 32 - --log-level=debug 33 - --source=service 34 - --source=ingress 35 - --namespace=dev 36 - --domain-filter=example.org. 37 - --provider=aws 38 - --registry=txt 39 - --txt-owner-id=dev.example.org 40 ``` 41 42 ### ExternalName Service 43 44 ```yaml 45 kind: Service 46 apiVersion: v1 47 metadata: 48 name: aws-service 49 annotations: 50 external-dns.alpha.kubernetes.io/hostname: tenant1.example.org,tenant2.example.org 51 spec: 52 type: ExternalName 53 externalName: aws.example.org 54 ``` 55 56 This will create 2 CNAME records pointing to `aws.example.org`: 57 ``` 58 tenant1.example.org 59 tenant2.example.org 60 ``` 61 62 ### ExternalName Service with an IP address 63 64 If `externalName` is an IP address, External DNS will create A records instead of CNAME. 65 66 ```yaml 67 kind: Service 68 apiVersion: v1 69 metadata: 70 name: aws-service 71 annotations: 72 external-dns.alpha.kubernetes.io/hostname: tenant1.example.org,tenant2.example.org 73 spec: 74 type: ExternalName 75 externalName: 111.111.111.111 76 ``` 77 78 This will create 2 A records pointing to `111.111.111.111`: 79 ``` 80 tenant1.example.org 81 tenant2.example.org 82 ```